I've tried using this code to fetch the apps that are running in my device:
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> runningAppProcessInfo = am.getRunningAppProcesses();
Log.d("apps", String.valueOf(runningAppProcessInfo));
I thought I would get the names of all the apps that are running in the device. Instead I get this when I debug:
[android.app.ActivityManager$RunningAppProcessInfo@ad46c50]
How do I get the list of all the apps that are presently running?