Navigation is a framework for navigating between 'destinations' within an Android application that provides a consistent API whether destinations are implemented as Fragments, Activities, or other components.

There are 3 major components in Navigation.

Below is an example of working with a NavController.
 // File:
 public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
   // For example purposes, assume our layout created in onCreateView has a Button
   // that should navigate the user to a destination
   Button b = view.findViewById(;

   b.setOnClickListener(v -> {
       // Retrieve the NavController from any View within a NavHost
       NavController navController = Navigation.findNavController(v);

   // Or use the convenience method in Navigation to combine the previous steps

Please see the documentation of individual classes for details.


Navigator.Name This annotation should be added to each Navigator subclass to denote the default name used to register the Navigator with a NavigatorProvider


NavController.OnNavigatedListener OnNavigatorNavigatedListener receives a callback when the associated controller navigates to a new destination. 
NavDirections An interface that describes a navigation operation: action's id and arguments  
NavHost A host is a single context or container for navigation via a NavController
Navigator.OnNavigatorNavigatedListener Listener for observing navigation events for this specific navigator. 
NavigatorProvider A NavigationProvider stores a set of Navigators that are valid ways to navigate to a destination. 


ActivityNavigator ActivityNavigator implements cross-activity navigation. 
ActivityNavigator.Destination NavDestination for activity navigation  
NavAction Navigation actions provide a level of indirection between your navigation code and the underlying destinations. 
NavController NavController manages app navigation within a NavHost
NavDeepLinkBuilder Class used to construct deep links to a particular destination in a NavGraph
NavDestination NavDestination represents one node within an overall navigation graph. 
NavGraph NavGraph is a collection of NavDestination nodes fetchable by ID. 
NavGraphNavigator A Navigator built specifically for NavGraph elements. 
Navigation Entry point for navigation operations. 
Navigator<D extends NavDestination> Navigator defines a mechanism for navigating within an app. 
NavInflater Class which translates a navigation XML file into a NavGraph  
NavOptions NavOptions stores special options for navigate actions  
NavOptions.Builder Builder for constructing new instances of NavOptions.