Issue
Is there any way to know your application is running ? I want to run a piece of code when Android app is just closed. Any suggestion will be appreciated.
Solution
Just to answer my own question now after so much time. When user close the app, the process is terminated with no notice. onDestroy is not guaranteed to be called. only when you explicitly call finish().
Answered By - mani
Answer Checked By - Clifford M. (JavaFixing Volunteer)