Answer the question
In order to leave comments, you need to log in
How to monitor the exit from the application in a specific activity?
Hello. I need to be able to catch the name of the screen in which the user completely closed the application. To do this, I created the App class and inherited from Application, and created an enum. but onDestroy doesn't work(cannot resolve method onDestroy)
Answer the question
In order to leave comments, you need to log in
In android, there is no concept of completely exiting the application. You can hang a listener on the life cycle and track that all Activities have stopped (onDestroy is not guaranteed).
onDestroy is the Activity method, and in your example you are trying to override it in the application.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question