# NavigationEventInput

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

*** ** * ** ***


```
public abstract class NavigationEventInput
```

<br />

Known direct subclasses [BrowserInput](https://developer.android.com/reference/androidx/navigationevent/BrowserInput), [DirectNavigationEventInput](https://developer.android.com/reference/androidx/navigationevent/DirectNavigationEventInput), [OnBackInvokedInput](https://developer.android.com/reference/androidx/navigationevent/OnBackInvokedInput)

|---|---|
| `https://developer.android.com/reference/androidx/navigationevent/BrowserInput` | A `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput` that translates browser history navigation events (popstate) into `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` events. |
| `https://developer.android.com/reference/androidx/navigationevent/DirectNavigationEventInput` | An input that can send events to a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher`. |
| `https://developer.android.com/reference/androidx/navigationevent/OnBackInvokedInput` | Provides input to a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` by registering an `https://developer.android.com/reference/android/window/OnBackInvokedCallback.html` to the passed in `https://developer.android.com/reference/androidx/navigationevent/OnBackInvokedInput#(android.window.OnBackInvokedDispatcher,kotlin.Int)`. |

Known indirect subclasses [OnBackInvokedDefaultInput](https://developer.android.com/reference/androidx/navigationevent/OnBackInvokedDefaultInput), [OnBackInvokedOverlayInput](https://developer.android.com/reference/androidx/navigationevent/OnBackInvokedOverlayInput)

|---|---|
| `https://developer.android.com/reference/androidx/navigationevent/OnBackInvokedDefaultInput` | Provides input to a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` by registering an `https://developer.android.com/reference/android/window/OnBackInvokedCallback.html` with the `https://developer.android.com/reference/android/window/OnBackInvokedDispatcher.html#PRIORITY_DEFAULT` priority to `https://developer.android.com/reference/androidx/navigationevent/OnBackInvokedDefaultInput#(android.window.OnBackInvokedDispatcher)`. |
| `https://developer.android.com/reference/androidx/navigationevent/OnBackInvokedOverlayInput` | Provides input to a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` by registering an `https://developer.android.com/reference/android/window/OnBackInvokedCallback.html` with the `https://developer.android.com/reference/android/window/OnBackInvokedDispatcher.html#PRIORITY_OVERLAY` priority to `https://developer.android.com/reference/androidx/navigationevent/OnBackInvokedOverlayInput#(android.window.OnBackInvokedDispatcher)`. |

*** ** * ** ***

An abstract class for components that generate and dispatch navigation events.

This class acts as the "input" side of the navigation system, translating platform-specific events (like system back gestures or button clicks) into standardized events that can be sent to a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher`.

Subclasses are responsible for implementing the logic that sources these events and calling the `dispatchOn...` methods (e.g., `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#dispatchOnBackStarted(androidx.navigationevent.NavigationEvent)`) to propagate them through the system.

An input must be registered with a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` using `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#addInput(androidx.navigationevent.NavigationEventInput)` to function.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` |   |
| `https://developer.android.com/reference/androidx/navigationevent/NavigationEventHandler` |   |

## Summary

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

| ### Public methods |
|---|---|
| `final boolean` | `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#hasEnabledBackHandlers()()` Tracks whether the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` has any enabled `https://developer.android.com/reference/androidx/navigationevent/NavigationEventHandler` for back navigation matching this input's priority scope. |
| `final boolean` | `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#hasEnabledForwardHandlers()()` Tracks whether the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` has any enabled `https://developer.android.com/reference/androidx/navigationevent/NavigationEventHandler` for forward navigation matching this input's priority scope. |
| `final boolean` | `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#hasEnabledHandlers()()` Tracks whether the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` has any enabled `https://developer.android.com/reference/androidx/navigationevent/NavigationEventHandler` matching this input's priority scope. |

| ### Protected methods |
|---|---|
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#dispatchOnBackCancelled()()` Notifies the dispatcher that the ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has been **cancelled**. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#dispatchOnBackCompleted()()` Notifies the dispatcher that the ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has **completed**. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#dispatchOnBackProgressed(androidx.navigationevent.NavigationEvent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEvent event)` Notifies the dispatcher that an ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has **progressed**. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#dispatchOnBackStarted(androidx.navigationevent.NavigationEvent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEvent event)` Notifies the dispatcher that a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has **started**. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#dispatchOnForwardCancelled()()` Notifies the dispatcher that the ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has been **cancelled**. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#dispatchOnForwardCompleted()()` Notifies the dispatcher that the ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has **completed**. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#dispatchOnForwardProgressed(androidx.navigationevent.NavigationEvent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEvent event)` Notifies the dispatcher that an ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has **progressed**. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/MainThread https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#dispatchOnForwardStarted(androidx.navigationevent.NavigationEvent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEvent event)` Notifies the dispatcher that a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has **started**. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread @https://developer.android.com/reference/androidx/annotation/EmptySuper https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#onAdded(androidx.navigationevent.NavigationEventDispatcher)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher dispatcher)` Called after this `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput` is added to `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#onAdded(androidx.navigationevent.NavigationEventDispatcher)`. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread @https://developer.android.com/reference/androidx/annotation/EmptySuper https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#onHasEnabledBackHandlersChanged(kotlin.Boolean)(boolean hasEnabledBackHandlers)` Called when the enabled state of back handlers in the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` changes. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread @https://developer.android.com/reference/androidx/annotation/EmptySuper https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#onHasEnabledForwardHandlersChanged(kotlin.Boolean)(boolean hasEnabledForwardHandlers)` Called when the enabled state of forward handlers in the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` changes. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread @https://developer.android.com/reference/androidx/annotation/EmptySuper https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#onHasEnabledHandlersChanged(kotlin.Boolean)(boolean hasEnabledHandlers)` Called when the enabled state of handlers (either back or forward) in the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` changes. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread @https://developer.android.com/reference/androidx/annotation/EmptySuper https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#onHistoryChanged(androidx.navigationevent.NavigationEventHistory)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEventHistory history)` Called when the `https://developer.android.com/reference/androidx/navigationevent/NavigationEventHistory` state in the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` changes. |
| `void` | `@https://developer.android.com/reference/androidx/annotation/MainThread @https://developer.android.com/reference/androidx/annotation/EmptySuper https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#onRemoved()()` Called after this `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput` is removed from a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher`. |

## Public constructors

### NavigationEventInput

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

```
public NavigationEventInput()
```

## Public methods

### hasEnabledBackHandlers

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

```
public final boolean hasEnabledBackHandlers()
```

Tracks whether the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` has any enabled `https://developer.android.com/reference/androidx/navigationevent/NavigationEventHandler` for back navigation matching this input's priority scope.

### hasEnabledForwardHandlers

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

```
public final boolean hasEnabledForwardHandlers()
```

Tracks whether the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` has any enabled `https://developer.android.com/reference/androidx/navigationevent/NavigationEventHandler` for forward navigation matching this input's priority scope.

### hasEnabledHandlers

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

```
public final boolean hasEnabledHandlers()
```

Tracks whether the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` has any enabled `https://developer.android.com/reference/androidx/navigationevent/NavigationEventHandler` matching this input's priority scope.

## Protected methods

### dispatchOnBackCancelled

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

```
@MainThread
protected final void dispatchOnBackCancelled()
```

Notifies the dispatcher that the ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has been **cancelled**.

This is a **terminal** event. The `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#transitionState()` will become `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState.Idle` and ready for a new gesture.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this input is not added to a dispatcher. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this dispatcher is disposed. |

### dispatchOnBackCompleted

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

```
@MainThread
protected final void dispatchOnBackCompleted()
```

Notifies the dispatcher that the ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has **completed**.

This is a **terminal** event, signaling that the navigation should be finalized (e.g., popping the back stack). The `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#transitionState()` will become `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState.Idle` and ready for a new gesture.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this input is not added to a dispatcher. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this dispatcher is disposed. |

### dispatchOnBackProgressed

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

```
@MainThread
protected final void dispatchOnBackProgressed(@NonNull NavigationEvent event)
```

Notifies the dispatcher that an ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has **progressed**.

The `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#transitionState()` will become `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState.InProgress`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEvent event` | The `https://developer.android.com/reference/androidx/navigationevent/NavigationEvent` describing the progress of the gesture. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this input is not added to a dispatcher. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this dispatcher is disposed. |

### dispatchOnBackStarted

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

```
@MainThread
protected final void dispatchOnBackStarted(@NonNull NavigationEvent event)
```

Notifies the dispatcher that a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has **started**.

The `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#transitionState()` will become `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState.InProgress`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEvent event` | The `https://developer.android.com/reference/androidx/navigationevent/NavigationEvent` describing the start of the gesture (e.g., touch position). |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this input is not added to a dispatcher. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this dispatcher is disposed. |

### dispatchOnForwardCancelled

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

```
@MainThread
protected final void dispatchOnForwardCancelled()
```

Notifies the dispatcher that the ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has been **cancelled**.

This is a **terminal** event. The `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#transitionState()` will become `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState.Idle` and ready for a new gesture.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this input is not added to a dispatcher. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this dispatcher is disposed. |

### dispatchOnForwardCompleted

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

```
@MainThread
protected final void dispatchOnForwardCompleted()
```

Notifies the dispatcher that the ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has **completed**.

This is a **terminal** event, signaling that the navigation should be finalized (e.g., popping the back stack). The `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#transitionState()` will become `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState.Idle` and ready for a new gesture.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this input is not added to a dispatcher. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this dispatcher is disposed. |

### dispatchOnForwardProgressed

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

```
@MainThread
protected final void dispatchOnForwardProgressed(@NonNull NavigationEvent event)
```

Notifies the dispatcher that an ongoing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has **progressed**.

The `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#transitionState()` will become `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState.InProgress`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEvent event` | The `https://developer.android.com/reference/androidx/navigationevent/NavigationEvent` describing the progress of the gesture. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this input is not added to a dispatcher. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this dispatcher is disposed. |

### dispatchOnForwardStarted

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

```
@MainThread
protected final void dispatchOnForwardStarted(@NonNull NavigationEvent event)
```

Notifies the dispatcher that a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has **started**.

The `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#transitionState()` will become `https://developer.android.com/reference/androidx/navigationevent/NavigationEventTransitionState.InProgress`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEvent event` | The `https://developer.android.com/reference/androidx/navigationevent/NavigationEvent` describing the start of the gesture (e.g., touch position). |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this input is not added to a dispatcher. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if this dispatcher is disposed. |

### onAdded

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

```
@MainThread
@EmptySuper
protected void onAdded(@NonNull NavigationEventDispatcher dispatcher)
```

Called after this `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput` is added to `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput#onAdded(androidx.navigationevent.NavigationEventDispatcher)`. This can happen when calling `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#addInput(androidx.navigationevent.NavigationEventInput)`. A `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput` can only be added to one `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` at a time.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher dispatcher` | The `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` that this input is now added to. |

### onHasEnabledBackHandlersChanged

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

```
@MainThread
@EmptySuper
protected void onHasEnabledBackHandlersChanged(boolean hasEnabledBackHandlers)
```

Called when the enabled state of back handlers in the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` changes.

The exact set of handlers this reflects depends on the `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher.Priority` this input was registered with.

| Parameters |
|---|---|
| `boolean hasEnabledBackHandlers` | Whether the connected dispatcher has any enabled back handlers matching this input's priority scope. |

### onHasEnabledForwardHandlersChanged

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

```
@MainThread
@EmptySuper
protected void onHasEnabledForwardHandlersChanged(boolean hasEnabledForwardHandlers)
```

Called when the enabled state of forward handlers in the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` changes.

The exact set of handlers this reflects depends on the `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher.Priority` this input was registered with.

| Parameters |
|---|---|
| `boolean hasEnabledForwardHandlers` | Whether the connected dispatcher has any enabled forward handlers matching this input's priority scope. |

### onHasEnabledHandlersChanged

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

```
@MainThread
@EmptySuper
protected void onHasEnabledHandlersChanged(boolean hasEnabledHandlers)
```

Called when the enabled state of handlers (either back or forward) in the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` changes.

This allows the input to enable or disable its own event sourcing. For example, a system back gesture input might only register for gestures when `hasEnabledHandlers` is `true`.

The exact set of handlers this reflects depends on the `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher.Priority` this input was registered with.

| Parameters |
|---|---|
| `boolean hasEnabledHandlers` | Whether the connected dispatcher has any enabled handlers (back or forward) matching this input's priority scope. |

### onHistoryChanged

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

```
@MainThread
@EmptySuper
protected void onHistoryChanged(@NonNull NavigationEventHistory history)
```

Called when the `https://developer.android.com/reference/androidx/navigationevent/NavigationEventHistory` state in the connected `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher` changes.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigationevent/NavigationEventHistory history` | The new, immutable snapshot of the navigation history. |

### onRemoved

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

```
@MainThread
@EmptySuper
protected void onRemoved()
```

Called after this `https://developer.android.com/reference/androidx/navigationevent/NavigationEventInput` is removed from a `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher`. This can happen when calling `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#removeInput(androidx.navigationevent.NavigationEventInput)` or `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher#dispose()` on the containing `https://developer.android.com/reference/androidx/navigationevent/NavigationEventDispatcher`.