Reputation: 14668
I am wondering about when the application class gets killed or restarted. If I have and activity that starts and a service. And then the activity is killed, but the service is alive, then is the Application Object killed?
Also, if I setup a broadcast receiver to an alarm that will start my application, then will the application class be created (again) or will it just bring it from onPause to OnResume?
Thank you
Upvotes: 3
Views: 772
Reputation: 5696
The application class is instantiated when your process is created. Each process has a unique instance of the application class. If your activity is killed and your service is alive (provided they are both on the same process), your application instance has to be alive.
If your process is alive, your application instance is alive. There are no onPause() / onResume() states for the application class.
More informations: http://developer.android.com/reference/android/app/Application.html
Upvotes: 5