稍微判断一下,我最近刚做了一个定时任务的功能。代码如下
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, planOnOff.hour);
calendar.set(Calendar.MINUTE, planOnOff.minute);
if (System.currentTimeMillis()>calendar.getTimeInMillis()) {
calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR)+1);
}
operation = PendingIntent.getBroadcast(mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
am.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), 3600*24*1000, operation);
如果觉得赞,给分吧少年!
换个软件不就好了,那么多闹钟供你选择呢