How to setup alarms again after reboot

66 views Asked by At

I am building an alarm clock application, then is purely dependent on alerting the user during the proper time an alarm is to go off. However, reading about AlarmManager, it appears that at device reboot, all alarms are removed.

As my app would then be rendered worthless if all the users alarms were erased, how can I prevent that from happening/ensure that all alarms are always in place whether reboot or not?

1

There are 1 answers

0
David M On

Have your application handle the ACTION_BOOT_COMPLETED intent to install alarms at boot:

Broadcast Action: This is broadcast once, after the system has finished booting. It can be used to perform application-specific initialization, such as installing alarms. You must hold the RECEIVE_BOOT_COMPLETED permission in order to receive this broadcast.