# OnBackInvokedInput

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

*** ** * ** ***

Common/AllAndroid/JVMJavaScript
- android

  ```
  @RequiresApi(value = 33)
  sealed class OnBackInvokedInput : NavigationEventInput
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.navigationevent.NavigationEventInput](https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput) ||
|   | ↳ | [androidx.navigationevent.OnBackInvokedInput](https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedInput) |

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

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedDefaultInput` | Provides input to a `https://developer.android.com/reference/kotlin/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/kotlin/androidx/navigationevent/OnBackInvokedDefaultInput#(android.window.OnBackInvokedDispatcher)`. |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedOverlayInput` | Provides input to a `https://developer.android.com/reference/kotlin/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/kotlin/androidx/navigationevent/OnBackInvokedOverlayInput#(android.window.OnBackInvokedDispatcher)`. |

*** ** * ** ***

Provides input to a `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` by registering an `https://developer.android.com/reference/android/window/OnBackInvokedCallback.html` to the passed in `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedInput#(android.window.OnBackInvokedDispatcher,kotlin.Int)`.

## Summary

| ### Protected constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedInput#OnBackInvokedInput(android.window.OnBackInvokedDispatcher,kotlin.Int)( onBackInvokedDispatcher: https://developer.android.com/reference/android/window/OnBackInvokedDispatcher.html, onBackInvokedCallbackPriority: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` | android |

| ### Protected functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedInput#onHasEnabledBackHandlersChanged(kotlin.Boolean)(hasEnabledBackHandlers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Called when the enabled state of back handlers in the connected `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` changes. | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigationevent/OnBackInvokedInput#onRemoved()()` Called after this `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput` is removed from a `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher`. | android |

### Inherited functions

From [androidx.navigationevent.NavigationEventInput](https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#dispatchOnBackCancelled()()`

Notifies the dispatcher that the ongoing `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has been **cancelled**.
android `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#dispatchOnBackCompleted()()`

Notifies the dispatcher that the ongoing `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has **completed**.
android `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#dispatchOnBackProgressed(androidx.navigationevent.NavigationEvent)(event: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent)`

Notifies the dispatcher that an ongoing `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has **progressed**.
android `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#dispatchOnBackStarted(androidx.navigationevent.NavigationEvent)(event: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent)`

Notifies the dispatcher that a `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_BACK()` navigation gesture has **started**.
android `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#dispatchOnForwardCancelled()()`

Notifies the dispatcher that the ongoing `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has been **cancelled**.
android `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#dispatchOnForwardCompleted()()`

Notifies the dispatcher that the ongoing `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has **completed**.
android `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#dispatchOnForwardProgressed(androidx.navigationevent.NavigationEvent)(event: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent)`

Notifies the dispatcher that an ongoing `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has **progressed**.
android `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#dispatchOnForwardStarted(androidx.navigationevent.NavigationEvent)(event: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent)`

Notifies the dispatcher that a `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventTransitionState#TRANSITIONING_FORWARD()` navigation gesture has **started**.
android `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/EmptySuper
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#onAdded(androidx.navigationevent.NavigationEventDispatcher)(dispatcher: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher)`

Called after this `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput` is added to `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#onAdded(androidx.navigationevent.NavigationEventDispatcher)`.
android `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/EmptySuper
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#onHasEnabledForwardHandlersChanged(kotlin.Boolean)(hasEnabledForwardHandlers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Called when the enabled state of forward handlers in the connected `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` changes.
android `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/EmptySuper
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#onHasEnabledHandlersChanged(kotlin.Boolean)(hasEnabledHandlers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

Called when the enabled state of handlers (either back or forward) in the connected `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` changes.
android `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/MainThread
@https://developer.android.com/reference/kotlin/androidx/annotation/EmptySuper
https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#onHistoryChanged(androidx.navigationevent.NavigationEventHistory)(history: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventHistory)`

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

### Inherited properties

From [androidx.navigationevent.NavigationEventInput](https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#hasEnabledBackHandlers()`

Tracks whether the connected `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` has any enabled `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventHandler` for back navigation matching this input's priority scope.
android `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#hasEnabledForwardHandlers()`

Tracks whether the connected `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` has any enabled `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventHandler` for forward navigation matching this input's priority scope.
android `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInput#hasEnabledHandlers()`

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

## Protected constructors

### OnBackInvokedInput

android

```
protected OnBackInvokedInput(
    onBackInvokedDispatcher: OnBackInvokedDispatcher,
    onBackInvokedCallbackPriority: Int
)
```

| Parameters |
|---|---|
| `onBackInvokedDispatcher: https://developer.android.com/reference/android/window/OnBackInvokedDispatcher.html` | the `https://developer.android.com/reference/android/window/OnBackInvokedDispatcher.html` to use. |
| `onBackInvokedCallbackPriority: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the priority to use. |

## Protected functions

### onHasEnabledBackHandlersChanged

android

```
protected open fun onHasEnabledBackHandlersChanged(hasEnabledBackHandlers: Boolean): Unit
```

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

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

| Parameters |
|---|---|
| `hasEnabledBackHandlers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the connected dispatcher has any enabled back handlers matching this input's priority scope. |

### onRemoved

android

```
protected open fun onRemoved(): Unit
```

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