Ok, guys, I have this repeated tasks to do, so I schedule cupple Alarms:
private static void scheduleAlarm(Context context, AlarmManager alarmManager, String action, long interval) {
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, new Intent(action), PendingIntent.FLAG_UPDATE_CURRENT);
alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + interval, pendingIntent);
}
But, when I change system time, all my Alarms are broken, i.e. they eventually fire, but when the system time becomes the same as time for alarms.
How do I deal with this issue?
When the user changes the system time, an event is broadcast with this Intent action:
android.intent.action.TIME_SETYou can listen for this Intent and reschedule your alarms.