When the phone is finish booting up I want to automatically re-register some alarms, based on hour, minute ++ infomation from a database.
I try to do this with a br
You do not want to do database I/O in any manifest-registered broadcast receiver. You do not know how long it will take (based on other device activity), and your onReceive()
method is running on the main application thread, so your time is limited and your CPU footprint is large.
Please pass control to an IntentService
for doing the database I/O and scheduling your alarms. The IntentService
will call your onHandleIntent()
on a background thread, so you can take the time you need, and the service automatically goes away when onHandleIntent()
completes.