Killing an app vs Killing a Service
<p>I'm using ActivityManager.killBackgroundProcesses() to kill processes by package name. Before I kill an application that doesn't use services (such as Calculator) I can see the app listed in TaskKiller and after using killBackgroundProcesses I don't see the icon. With an application that uses services I am having trouble. Even though I kill it I can still see it in TaskKiller. I am assuming it is because of the service using START_STICKY but how can I block it from getting restarted? You can use TaskKiller to kill services (it takes an additional step but it works so it is possible!). If I try to kill Pandora for example the music will stop playing but I can still see the services running when I open TaskKiller.</p>

<p>I'm using a loop to search through all running processes like so:</p>

<p>for(RunningAppProcessInfo info:activityManager.getRunningAppProcesses()){</p>

<p>When I find the process I am looking for I use the killBackgroundProcesses.
If I kill an app with no services I can run through the loop and see that it no longer shows up in the loop. When I kill an app with services I still see the same app in the loop.</p>

<p>What mechanism do I need to use to block services from restarting as TaskKiller does?</p>

<p>Please don't answer this question with the typical "Your not supposed to do that" or "Android isn't designed to do that". My users are requesting me to automatically kill (not close) other apps. The fact that TaskKiller is doing this means it is possible.</p>
