Chapter 24 More About Intents and Tasks
Clear the tasks listed in your overview screen. Run NerdLauncher and start CriminalIntent. This time,
when you pull up the overview screen you will see a separate task for CriminalIntent (Figure 24.11).
Figure 24.11 CriminalIntent now in its own task
If you start CriminalIntent from NerdLauncher again, you will not create a second CriminalIntent task.
The FLAG_ACTIVITY_NEW_TASK flag by itself creates one task per activity. CrimeListActivity already
has a task running, so Android will switch to that task instead of starting a new one.
Try this out. Open the detail screen for one of the crimes in CriminalIntent. Use the overview screen to
switch to NerdLauncher. Press on CriminalIntent in the list. You will be right back where you were in
the CriminalIntent app, viewing the details for a single crime.
Using NerdLauncher as a Home Screen
Who wants to start an app to start other apps? It would make more sense to offer NerdLauncher as a
replacement for the device’s Home screen. Open NerdLauncher’s AndroidManifest.xml and add to its
main intent filter.