NoOpNavigator

class NoOpNavigator : Navigator<NavDestination>
kotlin.Any
   ↳ androidx.navigation.Navigator<androidx.navigation.NavDestination>
   ↳ androidx.navigation.NoOpNavigator

A Navigator that only supports creating destinations.

Summary

Public constructors

A Navigator that only supports creating destinations.

Public methods
NavDestination

Construct a new NavDestination associated with this Navigator.

NavDestination
navigate(destination: NavDestination, args: Bundle?, navOptions: NavOptions?, navigatorExtras: Navigator.Extras?)

Navigate to a destination.

Boolean

Attempt to pop this navigator's back stack, performing the appropriate navigation.

Inherited functions
Inherited properties

Public constructors

NoOpNavigator

NoOpNavigator()

A Navigator that only supports creating destinations.

Public methods

createDestination

fun createDestination(): NavDestination

Construct a new NavDestination associated with this Navigator.

Any initialization of the destination should be done in the destination's constructor as it is not guaranteed that every destination will be created through this method.

Return
a new NavDestination
fun navigate(
    destination: NavDestination,
    args: Bundle?,
    navOptions: NavOptions?,
    navigatorExtras: Navigator.Extras?
): NavDestination

Navigate to a destination.

Requests navigation to a given destination associated with this navigator in the navigation graph. This method generally should not be called directly; NavController will delegate to it when appropriate.

Parameters
destination: NavDestination destination node to navigate to
args: Bundle? arguments to use for navigation
navOptions: NavOptions? additional options for navigation
navigatorExtras: Navigator.Extras? extras unique to your Navigator.
Return
The NavDestination that should be added to the back stack or null if no change was made to the back stack (i.e., in cases of single top operations where the destination is already on top of the back stack).

popBackStack

fun popBackStack(): Boolean

Attempt to pop this navigator's back stack, performing the appropriate navigation.

Implementations should return true if navigation was successful. Implementations should return false if navigation could not be performed, for example if the navigator's back stack was empty.

Return
true if pop was successful