# NavDestination

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

*** ** * ** ***

Common/AllAndroid/JVMJavaScript
- Cmn

  ```
  open class NavDestination
  ```
Known direct subclasses [ActivityNavigator.Destination](https://developer.android.com/reference/kotlin/androidx/navigation/ActivityNavigator.Destination), [BottomSheetNavigator.Destination](https://developer.android.com/reference/kotlin/androidx/compose/material/navigation/BottomSheetNavigator.Destination), [ComposeNavigator.Destination](https://developer.android.com/reference/kotlin/androidx/navigation/compose/ComposeNavigator.Destination), [DialogFragmentNavigator.Destination](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/DialogFragmentNavigator.Destination), [DialogNavigator.Destination](https://developer.android.com/reference/kotlin/androidx/navigation/compose/DialogNavigator.Destination), [DynamicIncludeGraphNavigator.DynamicIncludeNavGraph](https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/DynamicIncludeGraphNavigator.DynamicIncludeNavGraph), [FragmentNavigator.Destination](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/FragmentNavigator.Destination), [NavGraph](https://developer.android.com/reference/kotlin/androidx/navigation/NavGraph), [WearNavigator.Destination](https://developer.android.com/reference/kotlin/androidx/wear/compose/navigation/WearNavigator.Destination)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/ActivityNavigator.Destination` | NavDestination for activity navigation |
| `https://developer.android.com/reference/kotlin/androidx/compose/material/navigation/BottomSheetNavigator.Destination` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination` specific to `https://developer.android.com/reference/kotlin/androidx/compose/material/navigation/BottomSheetNavigator`. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/compose/ComposeNavigator.Destination` | NavDestination specific to `https://developer.android.com/reference/kotlin/androidx/navigation/compose/ComposeNavigator` |
| `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/DialogFragmentNavigator.Destination` | NavDestination specific to `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/DialogFragmentNavigator`. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/compose/DialogNavigator.Destination` | NavDestination specific to `https://developer.android.com/reference/kotlin/androidx/navigation/compose/DialogNavigator` |
| `https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/DynamicIncludeGraphNavigator.DynamicIncludeNavGraph` | The graph for dynamic-include. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/FragmentNavigator.Destination` | NavDestination specific to `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/FragmentNavigator` |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavGraph` | NavGraph is a collection of `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination` nodes fetchable by ID. |
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/navigation/WearNavigator.Destination` | NavDestination specific to `https://developer.android.com/reference/kotlin/androidx/wear/compose/navigation/WearNavigator` |

Known indirect subclasses [DynamicActivityNavigator.Destination](https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/DynamicActivityNavigator.Destination), [DynamicFragmentNavigator.Destination](https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/fragment/DynamicFragmentNavigator.Destination), [DynamicGraphNavigator.DynamicNavGraph](https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/DynamicGraphNavigator.DynamicNavGraph)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/DynamicActivityNavigator.Destination` | Destination for `https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/DynamicActivityNavigator`. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/fragment/DynamicFragmentNavigator.Destination` | Destination for dynamic feature navigator. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/DynamicGraphNavigator.DynamicNavGraph` | The `https://developer.android.com/reference/kotlin/androidx/navigation/NavGraph` for dynamic features. |

*** ** * ** ***

NavDestination represents one node within an overall navigation graph.

Each destination is associated with a `https://developer.android.com/reference/kotlin/androidx/navigation/Navigator` which knows how to navigate to this particular destination.

Destinations declare a set of [actions](https://developer.android.com/reference/androidx/navigation/NavDestination#putAction(kotlin.Int,androidx.navigation.NavAction)) that they support. These actions form a navigation API for the destination; the same actions declared on different destinations that fill similar roles allow application code to navigate based on semantic intent.

Each destination has a set of `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#arguments()` that will be applied when `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` to that destination. Any default values for those arguments can be overridden at the time of navigation.

NavDestinations should be created via `https://developer.android.com/reference/kotlin/androidx/navigation/Navigator#createDestination()`.

## Summary

| ### Nested types |
|---|
| `@https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-retention/index.html(value = https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-retention/-b-i-n-a-r-y/index.html) @https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-target/index.html(allowedTargets = [https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-a-n-n-o-t-a-t-i-o-n_-c-l-a-s-s/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.annotation/-annotation-target/-c-l-a-s-s/index.html]) annotation https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination.ClassType` This optional annotation allows tooling to offer auto-complete for the `android:name` attribute. |

| ### Public companion functions |
|---|---|---|
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination.https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#(androidx.navigation.NavDestination).hasRoute()()` Checks if the NavDestination's `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#route()` was generated from `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination.Companion#(androidx.navigation.NavDestination).hasRoute()` | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination.https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#(androidx.navigation.NavDestination).hasRoute(kotlin.reflect.KClass)(route: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<T>)` Checks if the NavDestination's route was generated from `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination.Companion#(androidx.navigation.NavDestination).hasRoute(kotlin.reflect.KClass)` | Cmn android |

| ### Protected companion functions |
|---|---|---|
| `https://developer.android.com/reference/java/lang/Class.html<C?>` | `<C : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#parseClassFromName(android.content.Context,kotlin.String,java.lang.Class)( context: https://developer.android.com/reference/android/content/Context.html, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, expectedClassType: https://developer.android.com/reference/java/lang/Class.html<C?> )` Parse the class associated with this destination from a raw name, generally extracted from the `android:name` attribute added to the destination's XML. | android |

| ### Public companion properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.sequences/-sequence/index.html<https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination>` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination.https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#(androidx.navigation.NavDestination).hierarchy()` Provides a sequence of the NavDestination's hierarchy. | Cmn android |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#NavDestination(kotlin.String)(navigatorName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#NavDestination(androidx.navigation.Navigator)(navigator: https://developer.android.com/reference/kotlin/androidx/navigation/Navigator<https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination>)` NavDestinations should be created via `https://developer.android.com/reference/kotlin/androidx/navigation/Navigator#createDestination()`. | Cmn android |

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addArgument(kotlin.String,androidx.navigation.NavArgument)(argumentName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, argument: https://developer.android.com/reference/kotlin/androidx/navigation/NavArgument)` Sets an argument type for an argument name | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(androidx.navigation.NavDeepLink)(navDeepLink: https://developer.android.com/reference/kotlin/androidx/navigation/NavDeepLink)` Add a deep link to this destination. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)(uriPattern: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Add a deep link to this destination. | Cmn android |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | android |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#fillInLabel(android.content.Context,android.os.Bundle)(context: https://developer.android.com/reference/android/content/Context.html, bundle: https://developer.android.com/reference/android/os/Bundle.html?)` Parses a dynamic label containing arguments into a String. | android |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction?` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#getAction(kotlin.Int)(id: @https://developer.android.com/reference/kotlin/androidx/annotation/IdRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction` for the given action ID. | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#hasDeepLink(androidx.navigation.NavUri)(deepLink: https://developer.android.com/reference/kotlin/androidx/navigation/NavUri)` Checks the given deep link `https://developer.android.com/reference/kotlin/androidx/navigation/NavUri`, and determines whether it matches a Uri pattern added to the destination by a call to `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)` . | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#hasDeepLink(androidx.navigation.NavDeepLinkRequest)(deepLinkRequest: https://developer.android.com/reference/kotlin/androidx/navigation/NavDeepLinkRequest)` Checks the given `https://developer.android.com/reference/kotlin/androidx/navigation/NavDeepLinkRequest`, and determines whether it matches a `https://developer.android.com/reference/kotlin/androidx/navigation/NavDeepLink` added to the destination by a call to `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)`. | Cmn android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#hasDeepLink(android.net.Uri)(deepLink: https://developer.android.com/reference/android/net/Uri.html)` Checks the given deep link `https://developer.android.com/reference/kotlin/androidx/navigation/NavUri`, and determines whether it matches a Uri pattern added to the destination by a call to `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)` . | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#hashCode()()` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#onInflate(android.content.Context,android.util.AttributeSet)(context: https://developer.android.com/reference/android/content/Context.html, attrs: https://developer.android.com/reference/android/util/AttributeSet.html)` Called when inflating a destination from a resource. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#putAction(kotlin.Int,androidx.navigation.NavAction)(actionId: @https://developer.android.com/reference/kotlin/androidx/annotation/IdRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, action: https://developer.android.com/reference/kotlin/androidx/navigation/NavAction)` Sets the `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction` destination for an action ID. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#putAction(kotlin.Int,kotlin.Int)(actionId: @https://developer.android.com/reference/kotlin/androidx/annotation/IdRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, destId: @https://developer.android.com/reference/kotlin/androidx/annotation/IdRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction` for the given `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#putAction(kotlin.Int,kotlin.Int)` and associates it with the `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#putAction(kotlin.Int,kotlin.Int)`. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#removeAction(kotlin.Int)(actionId: @https://developer.android.com/reference/kotlin/androidx/annotation/IdRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Unsets the `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction` for an action ID. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#removeArgument(kotlin.String)(argumentName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Unsets the argument type for an argument name. | Cmn android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#toString()()` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://developer.android.com/reference/kotlin/androidx/navigation/NavArgument>` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#arguments()` The arguments supported by this destination. | Cmn android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#displayName()` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#id()` The destination's unique ID. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#label()` The descriptive label of this destination. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#navigatorName()` The name associated with this destination's `https://developer.android.com/reference/kotlin/androidx/navigation/Navigator`. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavGraph?` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#parent()` Gets the `https://developer.android.com/reference/kotlin/androidx/navigation/NavGraph` that contains this destination. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#route()` The destination's unique route. | Cmn android |

## Public companion functions

### NavDestination.hasRoute

Cmn android Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavDestination.+function:hasRoute)

```
inline fun <T : Any> NavDestination.hasRoute(): Boolean
```

Checks if the NavDestination's `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#route()` was generated from `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination.Companion#(androidx.navigation.NavDestination).hasRoute()`

Returns true if equal, false otherwise.

| Parameters |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | the route from KClass |

### NavDestination.hasRoute

Cmn android Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavDestination.+function:hasRoute) Added in [2.8.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.8.0)

```
fun <T : Any> NavDestination.hasRoute(route: KClass<T>): Boolean
```

Checks if the NavDestination's route was generated from `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination.Companion#(androidx.navigation.NavDestination).hasRoute(kotlin.reflect.KClass)`

Returns true if equal, false otherwise.

| Parameters |
|---|---|
| `route: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<T>` | the route from KClass |

## Protected companion functions

### parseClassFromName

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

```
protected fun <C : Any?> parseClassFromName(
    context: Context,
    name: String,
    expectedClassType: Class<C?>
): Class<C?>
```

Parse the class associated with this destination from a raw name, generally extracted from the `android:name` attribute added to the destination's XML. This should be the class providing the visual representation of the destination that the user sees after navigating to this destination.

This method does name -\> Class caching and should be strongly preferred over doing your own parsing if your `https://developer.android.com/reference/kotlin/androidx/navigation/Navigator` supports the `android:name` attribute to give consistent behavior across all Navigators.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | Context providing the package name for use with relative class names and the ClassLoader |
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Absolute or relative class name. Null names will be ignored. |
| `expectedClassType: https://developer.android.com/reference/java/lang/Class.html<C?>` | The expected class type |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/Class.html<C?>` | The parsed class |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the class is not found in the provided Context's ClassLoader or if the class is not of the expected type |

## Public companion properties

### NavDestination.hierarchy

Cmn android Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavDestination.+symbol:hierarchy) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
val NavDestination.hierarchy: Sequence<NavDestination>
```

Provides a sequence of the NavDestination's hierarchy. The hierarchy starts with this destination itself and is then followed by this destination's `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#parent()`, then that graph's parent, and up the hierarchy until you've reached the root navigation graph.

## Public constructors

### NavDestination

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

```
NavDestination(navigatorName: String)
```

### NavDestination

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

```
NavDestination(navigator: Navigator<NavDestination>)
```

NavDestinations should be created via `https://developer.android.com/reference/kotlin/androidx/navigation/Navigator#createDestination()`.

This constructor requires that the given Navigator has a `https://developer.android.com/reference/kotlin/androidx/navigation/Navigator.Name` annotation.

## Public functions

### addArgument

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

```
fun addArgument(argumentName: String, argument: NavArgument): Unit
```

Sets an argument type for an argument name

| Parameters |
|---|---|
| `argumentName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | argument object to associate with destination |
| `argument: https://developer.android.com/reference/kotlin/androidx/navigation/NavArgument` | argument object to associate with destination |

### addDeepLink

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

```
fun addDeepLink(navDeepLink: NavDeepLink): Unit
```

Add a deep link to this destination. Uris that match the given `https://developer.android.com/reference/kotlin/androidx/navigation/NavDeepLink` uri sent to `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#handleDeepLink(androidx.navigation.NavDeepLinkRequest)` or `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` will trigger navigating to this destination.

In addition to a direct Uri match, the following features are supported:

Uris without a scheme are assumed as http and https. For example, `www.example.com` will match `http://www.example.com` and `https://www.example.com`. Placeholders in the form of `{placeholder_name}` matches 1 or more characters. The String value of the placeholder will be available in the arguments `https://developer.android.com/reference/kotlin/androidx/savedstate/SavedState` with a key of the same name. For example, `http://www.example.com/users/{id}` will match `http://www.example.com/users/4`. The `.*` wildcard can be used to match 0 or more characters.

These Uris can be declared in your navigation XML files by adding one or more `<deepLink app:uri="uriPattern" />` elements as a child to your destination.

Custom actions and mimetypes are also supported by `https://developer.android.com/reference/kotlin/androidx/navigation/NavDeepLink` and can be declared in your navigation XML files by adding `<app:action="android.intent.action.SOME_ACTION" />` or `<app:mimetype="type/subtype" />` as part of your deepLink declaration.

Deep link Uris, actions, and mimetypes added in navigation XML files will automatically replace instances of `${applicationId}` with the applicationId of your app. Programmatically added deep links should use [Context.getPackageName](https://developer.android.com/reference/android/content/Context#getPackageManager()) directly when constructing the uriPattern.

When matching deep links for calls to `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#handleDeepLink(androidx.navigation.NavDeepLinkRequest)` or `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` the order of precedence is as follows: the deep link with the most matching arguments will be chosen, followed by the deep link with a matching action, followed by the best matching mimeType (e.i. when matching mimeType image/jpg: image/ \* \> \*\\/jpg \> \*\\/ \*).

| Parameters |
|---|---|
| `navDeepLink: https://developer.android.com/reference/kotlin/androidx/navigation/NavDeepLink` | The NavDeepLink to add as a deep link |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#handleDeepLink(androidx.navigation.NavDeepLinkRequest)` |   |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` |   |

### addDeepLink

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

```
fun addDeepLink(uriPattern: String): Unit
```

Add a deep link to this destination. Matching Uris sent to `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#handleDeepLink(androidx.navigation.NavDeepLinkRequest)` or `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` will trigger navigating to this destination.

In addition to a direct Uri match, the following features are supported:

- Uris without a scheme are assumed as http and https. For example, `www.example.com` will match `http://www.example.com` and `https://www.example.com`.

- Placeholders in the form of `{placeholder_name}` matches 1 or more characters. The parsed value of the placeholder will be available in the arguments `https://developer.android.com/reference/kotlin/androidx/savedstate/SavedState` with a key of the same name. For example, `http://www.example.com/users/{id}` will match `http://www.example.com/users/4`.

- The `.*` wildcard can be used to match 0 or more characters.

These Uris can be declared in your navigation XML files by adding one or more `<deepLink app:uri="uriPattern" />` elements as a child to your destination.

Deep links added in navigation XML files will automatically replace instances of `${applicationId}` with the applicationId of your app. Programmatically added deep links should use [Context.getPackageName](https://developer.android.com/reference/android/content/Context#getPackageManager()) directly when constructing the uriPattern.

| Parameters |
|---|---|
| `uriPattern: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The uri pattern to add as a deep link |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#handleDeepLink(androidx.navigation.NavDeepLinkRequest)` |   |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` |   |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)` |   |

### equals

android

```
open operator fun equals(other: Any?): Boolean
```

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### fillInLabel

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

```
fun fillInLabel(context: Context, bundle: Bundle?): String?
```

Parses a dynamic label containing arguments into a String.

Supports String Resource arguments by parsing `R.string` values of `ReferenceType` arguments found in `android:label` into their String values.

Returns `null` if label is null.

Returns the original label if the label was a static string.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | Context used to resolve a resource's name |
| `bundle: https://developer.android.com/reference/android/os/Bundle.html?` | SavedState containing the arguments used in the label |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | The parsed string or null if the label is null |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if an argument provided in the label cannot be found in the bundle, or if the label contains a string template but the bundle is null |

### getAction

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

```
fun getAction(id: @IdRes Int): NavAction?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction` for the given action ID. This will recursively check the `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#parent()` of this destination if the action destination is not found in this destination.

| Parameters |
|---|---|
| `id: @https://developer.android.com/reference/kotlin/androidx/annotation/IdRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | action ID to fetch |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction?` | the `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction` mapped to the given action id, or null if one has not been set |

### hasDeepLink

Cmn

```
open fun hasDeepLink(deepLink: NavUri): Boolean
```

Checks the given deep link `https://developer.android.com/reference/kotlin/androidx/navigation/NavUri`, and determines whether it matches a Uri pattern added to the destination by a call to `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)` . It returns `true` if the deep link is a valid match, and `false` otherwise.

This should be called prior to `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` to ensure the deep link can be navigated to.

| Parameters |
|---|---|
| `deepLink: https://developer.android.com/reference/kotlin/androidx/navigation/NavUri` | to the destination reachable from the current NavGraph |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the deepLink exists for the destination. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)` |   |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` |   |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#hasDeepLink(androidx.navigation.NavUri)` |   |

### hasDeepLink

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

```
open fun hasDeepLink(deepLinkRequest: NavDeepLinkRequest): Boolean
```

Checks the given `https://developer.android.com/reference/kotlin/androidx/navigation/NavDeepLinkRequest`, and determines whether it matches a `https://developer.android.com/reference/kotlin/androidx/navigation/NavDeepLink` added to the destination by a call to `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)`. It returns `true` if the request is a valid match, and `false` otherwise.

This should be called prior to `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` to ensure the deep link can be navigated to.

| Parameters |
|---|---|
| `deepLinkRequest: https://developer.android.com/reference/kotlin/androidx/navigation/NavDeepLinkRequest` | to the destination reachable from the current NavGraph |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the deepLink exists for the destination. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)` |   |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` |   |

### hasDeepLink

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

```
open fun hasDeepLink(deepLink: Uri): Boolean
```

Checks the given deep link `https://developer.android.com/reference/kotlin/androidx/navigation/NavUri`, and determines whether it matches a Uri pattern added to the destination by a call to `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)` . It returns `true` if the deep link is a valid match, and `false` otherwise.

This should be called prior to `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` to ensure the deep link can be navigated to.

| Parameters |
|---|---|
| `deepLink: https://developer.android.com/reference/android/net/Uri.html` | to the destination reachable from the current NavGraph |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the deepLink exists for the destination. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addDeepLink(kotlin.String)` |   |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavController#navigate(androidx.navigation.NavUri)` |   |
| `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#hasDeepLink(androidx.navigation.NavUri)` |   |

### hashCode

android

```
open fun hashCode(): Int
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### onInflate

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

```
@CallSuper
open fun onInflate(context: Context, attrs: AttributeSet): Unit
```

Called when inflating a destination from a resource.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | local context performing inflation |
| `attrs: https://developer.android.com/reference/android/util/AttributeSet.html` | attrs to parse during inflation |

### putAction

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

```
fun putAction(actionId: @IdRes Int, action: NavAction): Unit
```

Sets the `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction` destination for an action ID.

| Parameters |
|---|---|
| `actionId: @https://developer.android.com/reference/kotlin/androidx/annotation/IdRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | action ID to bind |
| `action: https://developer.android.com/reference/kotlin/androidx/navigation/NavAction` | action to associate with this action ID |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unsupported-operation-exception/index.html` | this destination is considered a terminal destination and does not support actions |

### putAction

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

```
fun putAction(actionId: @IdRes Int, destId: @IdRes Int): Unit
```

Creates a `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction` for the given `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#putAction(kotlin.Int,kotlin.Int)` and associates it with the `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#putAction(kotlin.Int,kotlin.Int)`.

| Parameters |
|---|---|
| `actionId: @https://developer.android.com/reference/kotlin/androidx/annotation/IdRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | action ID to bind |
| `destId: @https://developer.android.com/reference/kotlin/androidx/annotation/IdRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | destination ID for the given action |

### removeAction

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

```
fun removeAction(actionId: @IdRes Int): Unit
```

Unsets the `https://developer.android.com/reference/kotlin/androidx/navigation/NavAction` for an action ID.

| Parameters |
|---|---|
| `actionId: @https://developer.android.com/reference/kotlin/androidx/annotation/IdRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | action ID to remove |

### removeArgument

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

```
fun removeArgument(argumentName: String): Unit
```

Unsets the argument type for an argument name.

| Parameters |
|---|---|
| `argumentName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | argument to remove |

### toString

android

```
open fun toString(): String
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### arguments

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

```
val arguments: Map<String, NavArgument>
```

The arguments supported by this destination. Returns a read-only map of argument names to `https://developer.android.com/reference/kotlin/androidx/navigation/NavArgument` objects that can be used to check the type, default value and nullability of the argument.

To add and remove arguments for this NavDestination use `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#addArgument(kotlin.String,androidx.navigation.NavArgument)` and `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#removeArgument(kotlin.String)`.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://developer.android.com/reference/kotlin/androidx/navigation/NavArgument>` | Read-only map of argument names to arguments. |

### displayName

Cmn

```
open val displayName: String
```

### id

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

```
var id: Int
```

The destination's unique ID. This should be an ID resource generated by the Android resource system.

If using safe args, setting this manually will override the ID that was set based on route from KClass.

### label

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

```
var label: CharSequence?
```

The descriptive label of this destination.

### navigatorName

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

```
val navigatorName: String
```

The name associated with this destination's `https://developer.android.com/reference/kotlin/androidx/navigation/Navigator`.

### parent

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

```
var parent: NavGraph?
```

Gets the `https://developer.android.com/reference/kotlin/androidx/navigation/NavGraph` that contains this destination. This will be set when a destination is added to a NavGraph via `https://developer.android.com/reference/kotlin/androidx/navigation/NavGraph#addDestination(androidx.navigation.NavDestination)`.

### route

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

```
var route: String?
```

The destination's unique route. Setting this will also update the `https://developer.android.com/reference/kotlin/androidx/navigation/NavDestination#id()` of the destinations so custom destination ids should only be set after setting the route.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | this destination's route, or null if no route is set |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | is the given route is empty |