I am developing an Android app and I want to detect when the user exits my app either by clicking the Back button or the Home button.
Also, an event like onIn
another option that you might consider is to check for the back button or home key press. This is done by overriding the onKeyDown() , listen for the back key/home key and override the default behaviour.
I've found a similar question that might help you out.
Android: Prompt user to save changes when Back button is pressed
Cheers