-3

I want to get all running app on my android device. Maybe, need to use PackageManager? I have tried used to PackageManager, but I did not succeed, maybe, you have better decision?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

3 Answers3

1

Using below code you can get running application list

ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> runningAppProcessInfo = am.getRunningAppProcesses();
subrahmanyam boyapati
  • 2,836
  • 1
  • 18
  • 28
1

You can detect information about running process using ActivityManager.

I think you should check with these same questions here:

How to get the list of running application

How to get all the tasks that are running currently

BlakeR
  • 33
  • 6
1

I suggest the following thread. Your question has already been answered.

ActivityManager has method getRunningTasks(int). ActivityManager seems to be the solution you are searching for.

 final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
    final List<RunningTaskInfo> recentTasks = activityManager.getRunningTasks(Integer.MAX_VALUE);

    for (int i = 0; i < recentTasks.size(); i++) 
    {
        Log.d("Executed app", "Application executed : " +recentTasks.get(i).baseActivity.toShortString()+ "\t\t ID: "+recentTasks.get(i).id+"");         
    }

Read here

jackabe
  • 345
  • 9
  • 23