long compareTime(long triggerAtTime, long now) {
if (triggerAtTime <= now) {
triggerAtTime += AlarmManager.INTERVAL_DAY * 7;//如果当前设置的触发时间小于、等于现在的时间,就让它在下一个星期响起来。
}
return triggerAtTime;
}
void setAlarm(AlarmManager alarmManager, long triggerAtMillis,
long intervalMillis, PendingIntent pendingIntent) {
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, triggerAtMillis,
intervalMillis, pendingIntent);
}