How to kill currently running task in android

No one can kill process except Android OS itself.

Most of the task killer in android market don’t kill the app they just restart the process

by using

public void restartPackage (String packageName)

when this method is called by your activity the operating system immediately called

savedInstanceState and save the state of that activity you want to kill. Now this process is

removed from memory and OS saved it state.Now when next time user start that activity it

will start from where it was killed or in other words restarted. You can verify it from any

task manager that they don’t kill the process because no one can do so. This method also

work in ICS.

for above method you can look at here . As far as i know killBackgroundProcesses (String packageName) is for API 8 and above.

Leave a Comment