When holding the home button on your phone a pop up comes up showing recent applications. Does anyone know how to do this same action through code? I need to be able to choose one in a listview.
Asked
Active
Viewed 3,133 times
3
-
Possible duplicate of [Get Recent and Running application list not processes](http://stackoverflow.com/questions/12376646/get-recent-and-running-application-list-not-processes) – Artificioo Mar 08 '16 at 13:51
3 Answers
6
You need to use getRunningTasks
From the docs:
public List<ActivityManager.RunningTaskInfo> getRunningTasks (int maxNum)
Return a list of the tasks that are currently running, with the most recent being first and older ones after in order

Ravi Vyas
- 12,212
- 6
- 31
- 47
0
getRunningAppProcesses() sounds like a method that could help you at whatever you're trying to accomplish.

otto
- 1,138
- 6
- 14
0
Look into getRecentTasks(int, int) also.
This should show the history, whether or not the app is still "running"

Mobius
- 699
- 4
- 11