# NavActionBuilder

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavDestinationBuilder.android.kt+class:androidx.navigation.NavActionBuilder) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

*** ** * ** ***


```
@NavDestinationDsl
public final class NavActionBuilder
```

<br />

*** ** * ** ***

DSL for building a `https://developer.android.com/reference/androidx/navigation/NavAction`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/navigation/NavActionBuilder#NavActionBuilder()()` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/Object.html>` | `https://developer.android.com/reference/androidx/navigation/NavActionBuilder#getDefaultArguments()()` The set of default arguments that should be passed to the destination. |
| `final int` | `https://developer.android.com/reference/androidx/navigation/NavActionBuilder#getDestinationId()()` The ID of the destination that should be navigated to when this action is used |
| `final void` | `https://developer.android.com/reference/androidx/navigation/NavActionBuilder#navOptions(kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavOptionsBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> optionsBuilder )` Sets the `https://developer.android.com/reference/androidx/navigation/NavOptions` for this action that should be used by default |
| `final void` | `https://developer.android.com/reference/androidx/navigation/NavActionBuilder#setDestinationId(kotlin.Int)(int value)` The ID of the destination that should be navigated to when this action is used |

## Public constructors

### NavActionBuilder

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public NavActionBuilder()
```

## Public methods

### getDefaultArguments

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final @NonNull Map<@NonNull String, Object> getDefaultArguments()
```

The set of default arguments that should be passed to the destination. The keys used here should be the same as those used on the `https://developer.android.com/reference/androidx/navigation/NavDestinationBuilder#argument(kotlin.String,kotlin.Function1)` for the destination.

All values added here should be able to be added to a `https://developer.android.com/reference/androidx/savedstate/SavedState`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/navigation/NavAction#defaultArguments()` |   |

### getDestinationId

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final int getDestinationId()
```

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

### navOptions

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final void navOptions(
    @NonNull Function1<@NonNull NavOptionsBuilder, Unit> optionsBuilder
)
```

Sets the `https://developer.android.com/reference/androidx/navigation/NavOptions` for this action that should be used by default

### setDestinationId

Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public final void setDestinationId(int value)
```

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