public final 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

public NavAction(
    @IdRes int destinationId,
    NavOptions navOptions,
    Bundle defaultArguments
)
Parameters
@IdRes int destinationId

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

NavOptions navOptions

special options for this action that should be used by default

Bundle defaultArguments

argument SavedState to be used by default

Public methods

getDefaultArguments

public final Bundle getDefaultArguments()

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

Returns
Bundle

SavedState of default argument values

getDestinationId

public final int getDestinationId()

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

getNavOptions

public final NavOptions getNavOptions()

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

setDefaultArguments

public final void setDefaultArguments(Bundle value)

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

Returns
void

SavedState of default argument values

setNavOptions

public final void setNavOptions(NavOptions value)

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

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.