I've read a lot around Android service. As I understand, the lifecycle is:
void onCreate()
void onStart(Intent intent)
...
void onDestroy()
http://www.linuxtopia.org/online_books/android/devguide/guide/topics/fundamentals.html
But there's is no onStop method. Questions:
- Why isn't there a stop method?
- What happens when a stopService request is made on my Service? (from outside, perhaps by Android itself). Can I detect this event?
- I'd like to enforce (or at least verify) that my service is a singleton within a process. How can I do this (or does Android enforce this behind the scenes)?
For context, I have some resources I'd like to allocate and release while the service is running (in a "started"), and another set of resources I'd like to allocate and release while the service is a "created" state.