NavAction
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 |
|---|
NavAction( |
Public methods |
|
|---|---|
boolean |
|
final Bundle |
The argument SavedState to be used by default when navigating to this action. |
final int |
The ID of the destination that should be navigated to when this action is used |
final NavOptions |
The NavOptions to be used by default when navigating to this action. |
int |
hashCode() |
final void |
setDefaultArguments(Bundle defaultArguments)The argument SavedState to be used by default when navigating to this action. |
final void |
setNavOptions(NavOptions navOptions)The NavOptions to be used by default when navigating to this action. |
@NonNull String |
toString() |
Public constructors
NavAction
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 defaultArguments)
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 navOptions)
The NavOptions to be used by default when navigating to this action.