The goal of any in-app navigation should be to provide a consistent and predictable experience to users. To meet this goal, the Navigation Architecture Component helps you build an app that adheres to each of the navigation principles below.
The app should have a fixed starting destination
Apps have a fixed destination which is the screen the user sees when they launch your app from the launcher. This destination should also be the last screen the user sees when they return to the launcher after pressing the back button.
A stack is used to represent the "navigation state" of an app
The navigation state of your app should be represented with a last in, first out structure. This "navigation stack" should have the start destination of the app at the bottom of the stack and the current destination as the top of the stack.
Operations that change the navigation stack should always operate on the top of the navigation stack, either by "pushing" a new destination onto the top of the stack or "popping" the top-most destination off the stack.
The Up button never exits your app
If a user is at the start destination, the Up button should not be shown. When your app is launched using a deep link on another app's task, Up should take users to the hierarchical parent destination and not back to the other app.
Up and Back are equivalent within your app's task
When the system Back button would not exit your app, such as when you are on your own task and not on the start destination, the Up button should function identically to the system Back button.
Deep linking to a destination or navigating to the same destination should yield the same stack
A user can enter an app at the start destination and navigate to a destination. A user can also use a deep link, if available, to navigate to the same destination. In both of these cases, the navigation stack should have the same stack of destinations. Specifically, the user should be able to use the Back or Up button, regardless of how they got to a destination, to navigate through destinations back to the start destination. Any existing navigation stack is removed and replaced with the deep link’s navigation stack.
This document explained some of the principles behind the design of the Navigation Architecture Component. Continue to Implementing navigation with the Navigation Architecture Component to learn how to integrate the Navigation Architecture Component in your app.
For further reading on the app architecture, refer to: