Challenge: Icons, Reordering Tasks
You used ResolveInfo.loadLabel(…) in this chapter to present useful names in your launcher. ResolveInfo provides a similar method called loadIcon() that retrieves an icon to display for each application. For a small challenge, add an icon for each application to NerdLauncher.
If you are interested in doing more, you can add another activity to NerdLauncher that switches between running tasks. To do this, use the ActivityManager system service, which provides information about currently running activities, tasks, and applications. Unlike PackageManager, Activity provides no getActivityManager() convenience method for getting at this system service.
Instead, call Activity.getSystemService() with the Activity.ACTIVITY_SERVICE ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access