Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 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 Unit
onRestoreState(@Nullable savedState: Bundle!)

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

open NavGraph

Creates a new NavGraph associated with this navigator.

open Boolean

open Bundle?

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

onRestoreState

open fun onRestoreState(@Nullable savedState: Bundle!): Unit

navigate

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

createDestination

@NonNull open fun createDestination(): NavGraph

Creates a new NavGraph associated with this navigator.

Return
NavGraph:

popBackStack

open fun popBackStack(): Boolean

onSaveState

@Nullable open fun onSaveState(): Bundle?