views:

51

answers:

1

Hi,

I have a intent receiver in my android manifest, but would like to give the user the opportunity to choose whether he/her wants the app to automatically start at the specific state. Until now, I've used a service with a broadcast receiver, but I really want to delete this service as it seems a bit unnecessary.

Can register the intent action only if the user wants it (I guess not)? If not, should I make a class that will be called every time the intent is received and checks the user's preference or should I keep the service?

Thank you very much

+1  A: 

Can register the intent action only if the user wants it (I guess not)?

No, but you can have both in your manifest and only enable the one you want. Perhaps leave them both disabled in the manifest to start, then based on the user's choice, enable the one they requested via the PackageManager.

CommonsWare
Thanks, just what I was looking for.
Kaloer