0

I have a notification that starts with a service..this service starts when the checkbox in the preferences in checked. (It's a checkboxpreferences)..the problem is that the service when the device boot not starts even if the checkbox is checked. Right now I have to uncheck and check again to start the notification.how can I resolve the problem?

David_D
  • 1,404
  • 4
  • 31
  • 65
  • you need to implement bradcast reciever for your problem....braodcast will call your service on boot of the device – WISHY Aug 19 '13 at 10:01
  • check this for reference http://www.vogella.com/articles/AndroidBroadcastReceiver/article.html – WISHY Aug 19 '13 at 10:01
  • Register a boot broadcast receiver that will start your service! Also check this link : http://stackoverflow.com/questions/2784441/trying-to-start-a-service-on-boot-on-android – Pavlos Aug 19 '13 at 10:03
  • but this receiver has to "control" the checkboxpreference state right? – David_D Aug 19 '13 at 10:04
  • you can use SharedPreferences or db to store the state of teh checkbox. – stack_ved Aug 19 '13 at 10:13
  • but my service has already a receiver..i mean, the notification is for determinate the battery level..so the receiver is on battery changed...can i do both? – David_D Aug 19 '13 at 11:44
  • this is what is written now in the manifest: ` - ` what you mean is write ` - ` ? two receiver? – David_D Aug 20 '13 at 10:10

0 Answers0