android中的定时任务AlarmManager

 

	private void requestUpdateFeatureBook() {
		AlarmManager am = (AlarmManager)getContext().getSystemService(Context.ALARM_SERVICE);

		PendingIntent sender = PendingIntent.getBroadcast(getContext(), 0,new Intent(Config.UPDATE_FEATUREBOOK), 0);
		am.cancel(sender);
		am.setRepeating(AlarmManager.RTC, System.currentTimeMillis()/*Config.FEATUREBOOK_UPDATE_TIME*/,Config.FEATUREBOOK_UPDATE_TIME, sender);
	}

你可能感兴趣的:(android)