class NavAction


Navigation actions provide a level of indirection between your navigation code and the underlying destinations. This allows you to define common actions that change their destination or NavOptions based on the current NavDestination.

The NavOptions associated with a NavAction are used by default when navigating to this action via NavController.navigate.

Actions should be added via NavDestination.putAction.

Summary

Public constructors

NavAction(
    destinationId: @IdRes Int,
    navOptions: NavOptions?,
    defaultArguments: SavedState?
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

SavedState?

The argument SavedState to be used by default when navigating to this action.

@IdRes Int

The ID of the destination that should be navigated to when this action is used

NavOptions?

The NavOptions to be used by default when navigating to this action.

Public constructors

NavAction(
    destinationId: @IdRes Int,
    navOptions: NavOptions? = null,
    defaultArguments: SavedState? = null
)
Parameters
destinationId: @IdRes Int

the ID of the destination that should be navigated to when this action is used.

navOptions: NavOptions? = null

special options for this action that should be used by default

defaultArguments: SavedState? = null

argument SavedState to be used by default

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

defaultArguments

Added in 1.0.0
var defaultArgumentsSavedState?

The argument SavedState to be used by default when navigating to this action.

Returns
SavedState?

SavedState of default argument values

destinationId

Added in 1.0.0
val destinationId: @IdRes Int

The ID of the destination that should be navigated to when this action is used

Added in 1.0.0
var navOptionsNavOptions?

The NavOptions to be used by default when navigating to this action.