I have my app, and I want it to exit once I switch to something else. example: when I'm in my app and press the home button, the app should exit, and disappear from the background running apps window. how would I do this? maybe in onDestroy?
2 Answers
Looks like a duplicate of How to quit android application programmatically. You can try use Activity.onPause method for your purpose, but check some tricky workflows like switching phone off etc.
1 Comment
Ian Rehwinkel
still a problem there: when i start the application, it instantly calls onPause