java - Is alarmmanager ALWAYS cleared after reboot? -


simple question: alarmmanager always cleared after reboot? cleared after reboot on devices , when user boots device shortly after booted off?

i need know because recreate app's alarm in onbootreceiver , want avoid having double alarms set.

is alarmmanager cleared after reboot?

definitely on full reboot. there devices have "quickboot" (htc comes mind), , have not run experiments see behavior there.

and when user boots device shortly after booted off?

yes.

i need know because recreate app's alarm in onbootreceiver , want avoid having double alarms set.

alarms in hashmap keyed pendingintent. setting alarm using equivalent pendingintent should replace prior alarm. "equivalent", mean:

  • same operation (activity, service, broadcast)
  • same request code
  • equivalent intent (matches via filterequals(), pretty means matches on except extras)
  • and i'd nervous using flag_cancel_current when defining new pendingintent

you can use adb shell dumpsys alarm confirm alarms set, sure wind right number of alarms.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -