AlarmManager object after turning off and on the phone

ぃ、小莉子 提交于 2019-12-05 08:57:49
Timothée Jeannin

The documentation about the AlarmManager says that :

Registered alarms are retained while the device is asleep (and can optionally wake the device up if they go off during that time), but will be cleared if it is turned off and rebooted.

It seems that the AlarmClock included by default by Android does work even after a reboot.

On way to keep your alarms working after a reboot, is to start your application on boot completed and set up all the alams again with the AlarmManager. (In fact you may want to just setup your alarms using a Broadcast, not start your app)

Here is a StackOverflow question dealing about lunching an app on startup.

You wan also check out how the default AlarmClock does this by reading from the source. You can read and download it from here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!