What is the right way to close apps in Android?

I'm new to the Android platform, and this is probably a dumb question, but...

How do you close an app?

When I'm in an app, and I want to get out, I just click on "Home" and move on, but I just installed a Task Manager app, and I noticed everything is left running.

Is there a way to exit apps? Or do I need to use the Task Manager every time I exit something?

Topic applications android

Category Android


If you exit the app using the BACK button then it will call onDestroy() on the current Activity, If you press HOME it only calls onPause()
Don't be too worried about it though, Activities won't drain battery they are just left in memory so they can be opened faster in the future.

I wouldn't recommend using one of those task killer apps Android is designed to keep that stuff in memory for a reason, using a task killer is only one more extra service tugging away at your battery.. What you need to watch out for is apps that run services in the background like twitter or email clients pulling their servers, any good app that has a service like that will have an option to turn it off.


I'm pretty sure that everything I've ever read says that the Back button is the right way to exit out of apps.

Pressing Home leaves them running in the background until Android decides that they're not needed any more, which can be handy if you just need to switch between apps to check something (holding Home for a couple of seconds gives you the list of recently running apps you can switch back to on most phones) but coming out using the back button tells the app that you want it to close.


Some apps have an "Exit" option in their menus. Most don't.

You don't really need to worry about it. You can just go to whatever app you need next. Android does a pretty good job freeing up resources when required.

Update: AndroidSpin did some real-world research.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.