Swiping programs from the process-list should kill/shut them down, right?

I listened to music and then swiped the music player away but the music was still playing.

How come?

Does swiping not kill processes? if so, how can i close them correctly?

  • Is this ICS related...? Give Android time to do the clean-up of the memory... and also.. depending on how the application is coded, give that time too! BTW I think you should have explicitly stated that, the android version that is. – t0mm13b Jul 8 '12 at 1:12
  • sorry, got that smartphone today (first smartphone). the version is 4.0.4. i want to be able to kill processes immediately just like a pc. btw: giving it time to shut down? as a programmer i dont see a reason why a program needs so much time to shut down! – Wandang Jul 8 '12 at 1:31
  • 1
    AFAIK, swiping apps out of the recent list stops its processes, but not its background services (which I believe is what the music player is using). This question may explain what you're seeing: What actually happens when you swipe an app out of the recent apps list? – eldarerathis Jul 8 '12 at 1:45
  • perfect, thanks. can u make this an answer so i can mark it? – Wandang Jul 8 '12 at 2:06

Taking Google's Music app as an example (I would wager most others are implemented similarly), there are two distinct parts that constitute the app:

  1. The foreground processes and tasks that the user interacts with
  2. The background service that actually handles music playback

Point 2 can be verified in this Android Developer's blog post wherein it is stated:

Music playback runs in a service to allow it to continue operating after the user leaves the music application.

This distinction ends up being important when you remove an app from the recent tasks list. As covered in my answer to another question, the following is what happens when you swipe an app out of the list, as stated by Android engineer Dianne Hackborn:

Actually, removing an entry in recent tasks will kill any background processes that exist for the process. It won't directly causes services to stop, however there is an API for them to find out the task was removed to decide if they want this to mean they should stop. This is so that removing say the recent task of an e-mail app won't cause it to stop checking for e-mail.

In this case, that means that the foreground tasks of the Music app are being stopped, but the background service (evidently) chooses to continue running. This is a product of the way the app is implemented, so you simply won't be able to stop music playback by swiping the app out of the list. Instead, you can try the following from the recent apps list (also covered in the above linked answer):

If you really want to completely stop an app, you can long press on recent tasks to go to app info, and hit force stop there.

  • Please note however that killing processes and stopping apps should be none of your concern, Android does it all for you. See: lifehacker.com/5650894/… – Paul Redert Jul 8 '12 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.