Register now for Android Dev Summit 2019!

NavGraphNavigator

open class NavGraphNavigator : Navigator<NavGraph!>
kotlin.Any
   ↳ androidx.navigation.Navigator<androidx.navigation.NavGraph>
   ↳ androidx.navigation.NavGraphNavigator

A Navigator built specifically for NavGraph elements. Handles navigating to the correct destination when the NavGraph is the target of navigation actions.

Summary

Public constructors

<init>(@NonNull navigatorProvider: NavigatorProvider)

Construct a Navigator capable of routing incoming navigation requests to the proper destination within a NavGraph.

Public methods

open NavGraph

Creates a new NavGraph associated with this navigator.

open NavDestination?
navigate(@NonNull destination: NavGraph, @Nullable args: Bundle?, @Nullable navOptions: NavOptions?, @Nullable navigatorExtras: Navigator.Extras?)

open Boolean

Inherited functions

Public constructors

<init>

NavGraphNavigator(@NonNull navigatorProvider: NavigatorProvider)

Construct a Navigator capable of routing incoming navigation requests to the proper destination within a NavGraph.

Parameters
navigatorProvider NavigatorProvider: NavigatorProvider used to retrieve the correct Navigator to navigate to the start destination

Public methods

createDestination

@NonNull open fun createDestination(): NavGraph

Creates a new NavGraph associated with this navigator.

Return
NavGraph:

navigate

@Nullable open fun navigate(@NonNull destination: NavGraph, @Nullable args: Bundle?, @Nullable navOptions: NavOptions?, @Nullable navigatorExtras: Navigator.Extras?): NavDestination?

popBackStack

open fun popBackStack(): Boolean