Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)

(gtxtreme123) #1
Switching between tasks

Try out the overview screen on your device or emulator. First, launch CriminalIntent from the Home
screen or from your app launcher. (If your device or emulator no longer has CriminalIntent installed,
open your CriminalIntent project in Android Studio and run it from there.) Select a crime from the
crime list. Then push the Home button to return to the Home screen. Next, launch BeatBox from the
Home screen or from your app launcher (or, if necessary, from Android Studio).


Open the overview screen by pressing the Recents button (Figure 24.7).


Figure 24.7  Overview screen versions


The overview screen displayed on the left in Figure 24.7 is what users will see if they are running
KitKat. The overview screen displayed on the right is what users running Lollipop or later will see. In
both cases, the entry displayed for each app (known as a card from Lollipop forward) represents the
task for each app. A screenshot of the activity at the top of each task’s back stack is displayed. Users
can press on the BeatBox or CriminalIntent entry to return to the app (and to whatever activity they
were interacting with in that app).


Users can clear an app’s task by swiping on the card entry to remove the card from the task list.
Clearing the task removes all activities from the application’s back stack.


Try clearing CriminalIntent’s task, then relaunching the app. You will see the list of crimes instead of
the crime you were editing before you cleared the task.

Free download pdf