Learn How to Enable Up Navigation Button in Your App

In one of the earlier article you have seen how the back button works. The user can navigate through activity history by the back button click.

The up button is different. It allows you to traverse through the Activity hierarchy.

Let’s say you have MainActivity. From MainActivity you navigate to DetailActivity. Now if you have declared MainActivity to be a parent of DetailActivity then you can navigate back to it using an up button.

To illustrate this I have added a DetailActivity to the ThemeDemoApp, as shown in the video.

Please follow the video to understand this better and you can refer to the source code for the example App here.