Unit |
addOnDestinationChangedListener(@NonNull listener: NavController.OnDestinationChangedListener)
Adds an OnDestinationChangedListener to this controller to receive a callback whenever the getCurrentDestination() or its arguments change.
The current destination, if any, will be immediately sent to your listener.
|
NavDeepLinkBuilder |
createDeepLink()
Create a deep link to a destination within this NavController.
|
NavBackStackEntry |
getBackStackEntry(@IdRes destinationId: Int)
Gets the topmost NavBackStackEntry for a destination id.
This is always safe to use with the current destination or its parent or grandparent navigation graphs as these destinations are guaranteed to be on the back stack.
|
NavBackStackEntry? |
getCurrentBackStackEntry()
Gets the topmost NavBackStackEntry .
|
NavDestination? |
getCurrentDestination()
Gets the current destination.
|
NavGraph |
getGraph()
Gets the topmost navigation graph associated with this NavController.
|
NavInflater |
getNavInflater()
Returns the inflater for this controller.
|
NavigatorProvider |
getNavigatorProvider()
Retrieve the NavController's NavigatorProvider . All Navigators used to construct the navigation graph for this nav controller should be added to this navigator provider before the graph is constructed.
Generally, the Navigators are set for you by the NavHost hosting this NavController and you do not need to manually interact with the navigator provider.
|
NavBackStackEntry? |
getPreviousBackStackEntry()
Gets the previous visible NavBackStackEntry .
This skips over any NavBackStackEntry that is associated with a NavGraph .
|
ViewModelStoreOwner |
getViewModelStoreOwner(@IdRes navGraphId: Int)
Gets the ViewModelStoreOwner for a NavGraph. This can be passed to androidx.lifecycle.ViewModelProvider to retrieve a ViewModel that is scoped to the navigation graph - it will be cleared when the navigation graph is popped off the back stack.
|
Boolean |
handleDeepLink(@Nullable intent: Intent?)
Checks the given Intent for a Navigation deep link and navigates to the deep link if present. This is called automatically for you the first time you set the graph if you've passed in an Activity as the context when constructing this NavController, but should be manually called if your Activity receives new Intents in Activity#onNewIntent(Intent) .
The types of Intents that are supported include:
The navigation graph should be set before calling this method.
|
Unit |
navigate(@IdRes resId: Int)
Navigate to a destination from the current navigation graph. This supports both navigating via an action and directly navigating to a destination.
|
Unit |
navigate(@IdRes resId: Int, @Nullable args: Bundle?)
Navigate to a destination from the current navigation graph. This supports both navigating via an action and directly navigating to a destination.
|
Unit |
navigate(@IdRes resId: Int, @Nullable args: Bundle?, @Nullable navOptions: NavOptions?)
Navigate to a destination from the current navigation graph. This supports both navigating via an action and directly navigating to a destination.
|
Unit |
navigate(@IdRes resId: Int, @Nullable args: Bundle?, @Nullable navOptions: NavOptions?, @Nullable navigatorExtras: Navigator.Extras?)
Navigate to a destination from the current navigation graph. This supports both navigating via an action and directly navigating to a destination.
|
Unit |
navigate(@NonNull deepLink: Uri)
Navigate to a destination via the given deep link Uri . NavDestination#hasDeepLink(Uri) should be called on the navigation graph prior to calling this method to check if the deep link is valid. If an invalid deep link is given, an IllegalArgumentException will be thrown.
|
Unit |
navigate(@NonNull deepLink: Uri, @Nullable navOptions: NavOptions?)
Navigate to a destination via the given deep link Uri . NavDestination#hasDeepLink(Uri) should be called on the navigation graph prior to calling this method to check if the deep link is valid. If an invalid deep link is given, an IllegalArgumentException will be thrown.
|
Unit |
navigate(@NonNull deepLink: Uri, @Nullable navOptions: NavOptions?, @Nullable navigatorExtras: Navigator.Extras?)
Navigate to a destination via the given deep link Uri . NavDestination#hasDeepLink(Uri) should be called on the navigation graph prior to calling this method to check if the deep link is valid. If an invalid deep link is given, an IllegalArgumentException will be thrown.
|
Unit |
navigate(@NonNull request: NavDeepLinkRequest)
Navigate to a destination via the given NavDeepLinkRequest . NavDestination#hasDeepLink(NavDeepLinkRequest) should be called on the navigation graph prior to calling this method to check if the deep link is valid. If an invalid deep link is given, an IllegalArgumentException will be thrown.
|
Unit |
navigate(@NonNull request: NavDeepLinkRequest, @Nullable navOptions: NavOptions?)
Navigate to a destination via the given NavDeepLinkRequest . NavDestination#hasDeepLink(NavDeepLinkRequest) should be called on the navigation graph prior to calling this method to check if the deep link is valid. If an invalid deep link is given, an IllegalArgumentException will be thrown.
|
Unit |
navigate(@NonNull request:< |