Showing list of running tasks


#1

The book says to use getRunningTasks() to return a List of ActivityManager.RunningTaskInfo to get the list of running tasks. But when displaying the list in getView I can’t figure out how to get the title of app or image of the app from an ActivityManager.RunningTaskInfo item


#2

I am referring to the second part of the challenge that asks the reader to add code to be able to swap between running tasks


#3

I figured it out. You can use RunningTaskInfo.baseActivity.getPackageName() to get the package name of the RunningTaskInfo item, then you can use the method talked about here:

http://stackoverflow.com/a/5841353/1438339

to get the app name from the package name.