When i press home key for long time in my android device.I get list of all recent applications. Now i want to kill all my recent applications pro grammatically from within my application. I am able to get list of all recent applications but not able to kill all apps.
I want to achieve it with android version 4.x
Can anyone guide me ?
First get a list of
RunningTaskInfo
records using the following:Reference
After that, you can use the process-ids in that list to terminate the relevant processes using either
depending upon whether you can kill that process. Way to kill these is detailed here.