# ViewTreeNavigationEventDispatcherOwner

Added in 1.0.0

*** ** * ** ***


```
public final class ViewTreeNavigationEventDispatcherOwner
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner` | `https://developer.android.com/reference/androidx/navigationevent/ViewTreeNavigationEventDispatcherOwner#(android.view.View).get()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html receiver)` Retrieve the `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner` associated with the given `https://developer.android.com/reference/android/view/View.html`. |
| `static final void` | `https://developer.android.com/reference/androidx/navigationevent/ViewTreeNavigationEventDispatcherOwner#(android.view.View).set(androidx.navigationevent.NavigationEventDispatcherOwner)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html receiver, https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner navigationEventDispatcherOwner )` Set the `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner` associated with the given `https://developer.android.com/reference/android/view/View.html`. |

## Public methods

### get

Artifact: [androidx.navigationevent:navigationevent](https://developer.android.com/jetpack/androidx/releases/navigationevent) [View Source](https://cs.android.com/search?q=file:androidx/navigationevent/ViewTreeNavigationEventDispatcherOwner.android.kt+function:findViewTreeNavigationEventDispatcherOwner) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigationevent#1.0.0)

```
public static final NavigationEventDispatcherOwner get(@NonNull View receiver)
```

Retrieve the `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner` associated with the given `https://developer.android.com/reference/android/view/View.html`. This may be used to add a callback for navigation events.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner` | The `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner` associated with this view and/or some subset of its ancestors |

### set

Artifact: [androidx.navigationevent:navigationevent](https://developer.android.com/jetpack/androidx/releases/navigationevent) [View Source](https://cs.android.com/search?q=file:androidx/navigationevent/ViewTreeNavigationEventDispatcherOwner.android.kt+function:setViewTreeNavigationEventDispatcherOwner) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigationevent#1.0.0)

```
public static final void set(
    @NonNull View receiver,
    NavigationEventDispatcherOwner navigationEventDispatcherOwner
)
```

Set the `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner` associated with the given `https://developer.android.com/reference/android/view/View.html`. Calls to `https://developer.android.com/reference/androidx/navigationevent/package-summary#(android.view.View).findViewTreeNavigationEventDispatcherOwner()` from this view or descendants will return `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner`.

This should only be called by constructs such as activities or dialogs that manage a view tree and handle the dispatch of navigation events. Callers should only set a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner` that will be *stable.*

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner navigationEventDispatcherOwner` | `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcherOwner` associated with the `https://developer.android.com/reference/android/view/View.html` |