• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to get recently launched apps in android

Hi,

Long Press of homekey gives a list of recently launched applications.
I am trying to develop a app based on this.

I came to abt these API's:
ActivityManager.RecentTaskInfo Information you can retrieve about tasks that the user has most recently started or visited.
ActivityManager.RunningServiceInfo Information you can retrieve about a particular Service that is currently running in the system.
ActivityManager.RunningTaskInfo Information you can retrieve about a particular task that is currently "running" in the system.


But my question is:
ActivityManager am = (ActivityManager)context.getSystemService(Context. ACTIVITY_SERVICE);
List<ActivityManager.RecentTaskInfo> recentTasks = am.getRecentTasks(MAX_RECENT_TASKS, 0);


After making these calls, how to iterator the List(or recentTasks list) ..so that we can get a list of apps.


Thanks,
Shruthi
 
Back
Top Bottom