# ActivityNavArgsLazyKt

Added in 2.4.0

*** ** * ** ***


```
public final class ActivityNavArgsLazyKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavArgsLazy<@https://developer.android.com/reference/androidx/annotation/NonNull Args>` | `@https://developer.android.com/reference/androidx/annotation/MainThread <Args extends https://developer.android.com/reference/androidx/navigation/NavArgs> https://developer.android.com/reference/androidx/navigation/ActivityNavArgsLazyKt#(android.app.Activity).navArgs()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Activity.html receiver)` Returns a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-lazy/index.html` delegate to access the Activity's extras as an `https://developer.android.com/reference/androidx/navigation/package-summary#(android.app.Activity).navArgs()` instance. |

## Public methods

### navArgs

Artifact: [androidx.navigation:navigation-runtime](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/ActivityNavArgsLazy.android.kt+function:navArgs)

```
@MainThread
public static final @NonNull NavArgsLazy<@NonNull Args> <Args extends NavArgs> navArgs(@NonNull Activity receiver)
```

Returns a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-lazy/index.html` delegate to access the Activity's extras as an `https://developer.android.com/reference/androidx/navigation/package-summary#(android.app.Activity).navArgs()` instance.

It is strongly recommended that this method only be used when the Activity is started by `https://developer.android.com/reference/androidx/navigation/NavController#navigate(kotlin.Int)` with the corresponding `https://developer.android.com/reference/androidx/navigation/NavDirections` object, which ensures that the required arguments are present.

```
class MyActivity : Activity() {
    val args: MyActivityArgs by navArgs()
}
```

This property can be accessed only after the Activity is attached to the Application, and access prior to that will result in IllegalStateException.