I'm executing the following piece of code:
ActivityManager actvityManager = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);
List<RunningTaskInfo> procInfos = actvityManager.getRunningTasks(1000);
Then, I kill one process I'm interested in with
actvityManager.killBackgroundProcesses(process.baseActivity.getPackageName());
where process is an entry from procInfos.
The problem is if I run getRunningTasks again - it would still show the process I (presumably) killed, while a task manager for Android listed that process before calling killBackgroundProcesses and removed it from list after that call.
So, any ideas on how does task manager get its list of running processes? And is it normal that I have successfully killed 3rd-party process on an unrooted device?