Enabling Ancestral Navigation

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. Ancestral navigation, on the other hand, takes you up the app hierarchy. (It is sometimes called hierarchical navigation.)

Android makes it easy to use the app icon on the action bar for ancestral navigation. You can implement it to go “home” – all the way up the hierarchy to the app’s initial screen. In fact, the icon was originally called the app’s Home button. However, Android now recommends that you implement the app icon to go up just one level to the parent of the current activity. When you do this, the icon becomes the Up button.

In ...

Get Android Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.