January 2017
Beginner to intermediate
624 pages
22h 42m
English
So far, CriminalIntent relies heavily on the Back button to navigate around the app. Using the Back button is temporal navigation. It takes you to where you were last. Hierarchical navigation, on the other hand, takes you up the app hierarchy. (It is sometimes called ancestral navigation.)
In hierarchical navigation, the user navigates up by pressing the Up button on the left side of the toolbar.
Enable hierarchical navigation in CriminalIntent by adding a parentActivityName attribute in the AndroidManifest.xml file.
Listing 13.11 Turning on the Up button (AndroidManifest.xml)
<activity
android:name=".CrimePagerActivity"
android:parentActivityName=".CrimeListActivity">
</activity>
Read now
Unlock full access