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: Bundle?
)

Public functions

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

Public properties

Bundle?

The argument bundle 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

Added in 1.0.0
NavAction(
    destinationId: @IdRes Int,
    navOptions: NavOptions? = null,
    defaultArguments: Bundle? = 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: Bundle? = null

argument bundle 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 defaultArgumentsBundle?

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

Returns
Bundle?

bundle 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.