Tell me more ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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?

share|improve this question

6 Answers

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.

share|improve this answer
1  
I have noticed a couple apps that do eat through a lot of battery in this paused state. Namely, the latest version of Google Maps and a game I've got called GalaxIR. So keep an eye out for bad offenders and be sure to close those ones properly. – keithjgrant Sep 24 '10 at 23:21
1  
you are mistaken, if it is eating your batter that is a background service. – schwiz Sep 24 '10 at 23:43
5  
It is indeed possible to have an application that is not well developed and does not follow the Android application life cycle. For instance, a thread can be left active in an activity even after it was paused by the OS (by pressing Home), in this case the app will continue using battery. – jmbouffard Feb 4 '11 at 12:52
1  
I have found that many apps do not exit when I hit the Back button. For example:Pandora, G – Clay Nichols Dec 23 '12 at 0:32
1  
(my edit time expired)....other apps that don't close on Back button: Pandora (which even continues to play after pressing Back), Google Play Store, FaceBook, Podkicker. The way I'm testing is to click the Back button until the app disappears (usually that puts me back on Home) and then running Easy Task Killer. – Clay Nichols Dec 23 '12 at 0:40
show 4 more comments

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.

share|improve this answer
3  
Holding the Home button just list the last 6 opened apps, not the running one. – Loïc Wolff Aug 30 '10 at 13:30
@Loïc: it shows 8 for me. – Al Everett Feb 4 '11 at 14:19
1  
@LoicWolff, AlEverett It depends on the launcher in question that is used and the ROM itself. – t0mm13b Jul 17 '12 at 16:13

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.

share|improve this answer
Nice link, ty :) – Flow Sep 2 '11 at 16:19

In Android, applications never need to be closed and the OS is taking care of cleaning the memory of any remaining applications when the resources are needed elsewhere. Using a task killer will just break the normal operation of the OS and could even slow down the device because the applications will always have to be reloaded from the start.

Android application life cycle is working in a way that applications that are not on top are moved in a paused state that doesn't use any cpu anymore; only the memory content is kept in case the application is opened again; and the memory will be freed if needed.

This being said, the application developer has the responsibility to follow the application life cycle when he creates his application so some bugs or mistakes can happen that will result in an application that never really stops or pause. If you encounter such application and what to close it you can do it through the "Settings" -> "applications" -> "Manage applications" by selecting "Force stop" on the application.

But I would really not recommend using a task killer that is constantly running on the device.

share|improve this answer

Just want to add in schwiz's answer that it's just few lines of code needed to override the functionality of the back button. So it's not always reliable to close the app. So if the app developer doesn't want to close the app on pressing the back button, it won't get closed.

Although most good app developers popup an alert dialog on pressing back button on home menu of the app, asking if the user intends to exit the app or not, if you click on exit, it does close the app.

The correct answer could be this, the closure of the app is completely upon the app developer, if they wants the app to close on pressing the home button, they'll put the exit code in onPause(). If they want it on back button, they'll put it in the onBackKeyPressed. So it's not really in hand of the user.

The user can just avoid using the apps which doesn't provide the proper closing functionality, when not needed. The task managers are not a good way to close the app, since it can crash the app and doesn't give them a chance to save their state.

The OS does close the app whenever necessary, so you should not worry too much about it.

Edit:
There's an option to destroy the applications, as soon as you leave the app i.e. when you click the home key. You can go to Settings->Developer Options->Don't keep Activities. Although it's a developer option, but if you're too concerned about the apps running in background, you can use this option. But keep in mind that it's not recommended to be used by non-developers.

share|improve this answer

i tried many kill apps, and found that the best way is to install both (go taskmanager) and (fast reboot). when used together, it will work, and will free the memory. another option is to upgrade to android (ice cream sandwich 4.0.4), which allow control (close) of apps. good luck.

share|improve this answer
Task killers are not there to free memory (doesn't work) or save battery (doesn't work either, as many apps simply restart -- so it has the opposite effect). They are for the case of an app playing havoc and thus need to be shot as otherwise the device may get "unusable" as that app consumes all CPU, or the app uploads all your private pron to Facebook ;) – Izzy Aug 17 '12 at 11:18

protected by eldarerathis Aug 15 '12 at 13:30

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.