0

I am trying this method but it is deprecated.

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

for (int i = 0; i < tasks.size(); i++) {
    Log.e("Running task", "Running task: " + tasks.get(i).baseActivity.toShortString() + "\t\t ID: " + tasks.get(i).id);
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
Kdon Patel
  • 107
  • 1
  • 15
  • not working only launcher app and app that I have developed is listing – Kdon Patel Nov 19 '19 at 07:02
  • Then i think this have the same problem as yours: https://stackoverflow.com/questions/37974894/why-i-cant-see-all-running-apps-in-android-programmatically . The OP in this question, commented in one of the answers that this solved his/her problem: https://stackoverflow.com/questions/30619349/android-5-1-1-and-above-getrunningappprocesses-returns-my-application-packag/32366476#32366476 – Nathan Nov 19 '19 at 07:34

0 Answers0