0

How we find recently running application. I use this code but show only working app.

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+"");         
}
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197

1 Answers1

0

I found something in here which should help:

https://gist.github.com/rmkrishna/7e133bcf1a918a02f2c882c1d7011b18

First of all, it gets all recent apps.

It has the Android Manifest and Java code.

I think it's fine to give you this since the contributor has been gone for several months now.

I thought of giving you this link since I read in your comment that yours only shows working apps, if that above doesn't want to work...

Tell me, I'll offer an alternative.

JumperBot_
  • 551
  • 1
  • 6
  • 19