How to run a thread in background, after the device is rebooted. I'm trying to re schedule the alarm using alarm manager after the device is rebooted. But miserably it is ringing once after reboot and the scheduled alarms are cleared after reboot. so i've to make a thread run in background service that re-schedules the alarm taking the time from the database. How to achieve it? any help is highly appreciated and thanks in advance...
Asked
Active
Viewed 167 times
1 Answers
1
You can listen for a reboot event by setting up BroadcastReceiver for ACTION_BOOT_COMPLETED

Alexander Kulyakhtin
- 47,782
- 38
- 107
- 158
-
Interestingly in this post http://stackoverflow.com/questions/2784441/trying-to-start-a-service-on-boot-on-android they say BOOT_COMPLETE is sent to applications before external storage is mounted. So if application is installed to external storage it won't receive BOOT_COMPLETE broadcast message. Didn't know that – Alexander Kulyakhtin Nov 24 '11 at 14:46