Q:

Stopping an app from starting on boot

I have an app that starts when the phone starts. In the app I have an option for the user to stop showing a notification from the app. The notification is related to the boot_complete action (it starts a service). I'm wondering how would I stop the App from starting on boot up if the notification is turn off? I'm thinking on setting a shared preference to "No" if the notification is turned off and then check that on the boot complete broadcast. If the preference is set to "No", then nothing will start if it's set to "Yes" then it will start. Is that the best way of doing it or is there a better way to do it?

A:

Yes this is the best way to do this, just implement it in your BroadcastReceiver. I have implemented this multiple times in my apps, it seems to work well.

