In my application, I set an alarm
AlarmManager alarmMgr = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); ... PendingIntent pendingIntent = PendingIntent.getBroadcast(context, id, intent, PendingIntent.FLAG_UPDATE_CURRENT); ... alarmMgr.set(AlarmManager.RTC_WAKEUP, time.getTimeInMillis(), pendingIntent);
It works great if I do not turn off and turn on the phone.
To be more specific, let's say at 10:20, I set the alarm at 10:22, and I turned off and turned on the phone at 10:21, the alarm will not work.
What could be the problem? Is this a broadcast problem for the pending object, or do I need to set some flags of the alarmManager object to work in such conditions?
source share