3

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.

blahdiblah
  • 32,000
  • 21
  • 97
  • 150
user861040
  • 657
  • 1
  • 9
  • 13
  • 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 Answers3

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
  • 11,992
  • 6
  • 30
  • 45
0

getRunningAppProcesses() sounds like a method that could help you at whatever you're trying to accomplish.

otto
  • 1,128
  • 6
  • 14
0

Look into getRecentTasks(int, int) also.
This should show the history, whether or not the app is still "running"

Mobius
  • 689
  • 4
  • 11