Is there an android app :: onDestroy () for Android?

Hi, I am using Application :: onCreate to put my initialization code for my application, but while waiting for some time and starting other applications, I noticed that an instance of the Application class is being created again ...

How to detect globally when Android closes my application instance?

+7
source share
3 answers

I used the service class and have not had any problems since. If anyone has a better answer, let me know.

+3
source

I am not an experienced Android developer. But as a newbie, I think you can use the onDestroy () method for Activity.

It is a good idea for you to take a look at the life cycle of an activity.

(Lifecycle search in the following link) http://developer.android.com/guide/topics/fundamentals/activities.html

+1
source

How to detect globally when Android disconnects my application instance?

You cannot do this. The user / environment can kill the application manually during production. Android will not give you any feedback on this.

PS If you are using an emulated process environment, you can take a look at the onTerminate application.

+1
source

All Articles