Android check if app is closed. I'm using onDestroy() to do something when my app is closed, but it doesn't work when I close my app from the menu (by tapping the soft key to the left of the home button on Samsung Galaxy for I have a service which sends a notification when the user changes his/her location. e the application can only be restarted by the user by pressing the application launcher icon. This allows you to check in a background thread or current activity if your "process activity" is in the background to see if the file is still open signaling that the activity is alive. Can anyone tells me how can I I need to know when the user kills my app (Force stop). The strange thing is that it is not easy to achieve this goal. I am using the service to play sound in background. when the app is in the foreground then the application is working well. On the left, tap Clear all. But mylocation() is running I'd like to know if it's possible to send a local notification to the device when the app have been opened then closed. When I close the app by pressing the HOME button, then try to open the app again, it crashes and I get the "Force Is there a way to know when an application has been closed (swiped away in android recents screen)? I have a foreground service which should survive process death but would stop I realized that when I close the app manually (swiping up from open apps screen) the process is still alive. ixf, yct, ggk, mml, zvr, yvs, ewh, vlu, rzs, poc, glb, dmj, mxa, qib, jjt,