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 viafilterequals()
, pretty means matches on except extras) - and i'd nervous using
flag_cancel_current
when defining newpendingintent
you can use adb shell dumpsys alarm
confirm alarms set, sure wind right number of alarms.
Comments
Post a Comment