How to get recently launched apps in android


Last Updated:

  1. shruthi_001

    shruthi_001 New Member This Topic's Starter

    Joined:
    Aug 16, 2009
    Messages:
    1
    Likes Received:
    0
    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
     

    Advertisement

Share This Page

Loading...