# OnBackPressedDispatcherOwner

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

*** ** * ** ***


```
public interface OnBackPressedDispatcherOwner extends LifecycleOwner
```

<br />

Known direct subclasses [ComponentActivity](https://developer.android.com/reference/androidx/activity/ComponentActivity), [ComponentDialog](https://developer.android.com/reference/androidx/activity/ComponentDialog)

|---|---|
| `https://developer.android.com/reference/androidx/activity/ComponentActivity` | Base class for activities that enables composition of higher level components. |
| `https://developer.android.com/reference/androidx/activity/ComponentDialog` | Base class for dialogs that enables composition of higher level components. |

Known indirect subclasses [AlertDialog](https://developer.android.com/reference/androidx/appcompat/app/AlertDialog), [AppCompatActivity](https://developer.android.com/reference/androidx/appcompat/app/AppCompatActivity), [AppCompatDialog](https://developer.android.com/reference/androidx/appcompat/app/AppCompatDialog), [BaseCarAppActivity](https://developer.android.com/reference/androidx/car/app/activity/BaseCarAppActivity), [CarAppActivity](https://developer.android.com/reference/androidx/car/app/activity/CarAppActivity), [FragmentActivity](https://developer.android.com/reference/androidx/fragment/app/FragmentActivity), [LauncherActivity](https://developer.android.com/reference/androidx/car/app/activity/LauncherActivity), [MediaRouteChooserDialog](https://developer.android.com/reference/androidx/mediarouter/app/MediaRouteChooserDialog), [MediaRouteControllerDialog](https://developer.android.com/reference/androidx/mediarouter/app/MediaRouteControllerDialog)

|---|---|
| `https://developer.android.com/reference/androidx/appcompat/app/AlertDialog` | A subclass of Dialog that can display one, two or three buttons. |
| `https://developer.android.com/reference/androidx/appcompat/app/AppCompatActivity` | Base class for activities that wish to use some of the newer platform features on older Android devices. |
| `https://developer.android.com/reference/androidx/appcompat/app/AppCompatDialog` | Base class for AppCompat themed `https://developer.android.com/reference/android/app/Dialog.html`s. |
| `https://developer.android.com/reference/androidx/car/app/activity/BaseCarAppActivity` | Core logic for CarAppLibrary Activity interaction with a host. |
| `https://developer.android.com/reference/androidx/car/app/activity/CarAppActivity` | The class representing a car app activity in the main display. |
| `https://developer.android.com/reference/androidx/fragment/app/FragmentActivity` | Base class for activities that want to use the support-based `https://developer.android.com/reference/androidx/fragment/app/Fragment`. |
| `https://developer.android.com/reference/androidx/car/app/activity/LauncherActivity` | This class handles providing the right launcher activity when running native applications and Car App Library applications. |
| `https://developer.android.com/reference/androidx/mediarouter/app/MediaRouteChooserDialog` | This class implements the route chooser dialog for `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter`. |
| `https://developer.android.com/reference/androidx/mediarouter/app/MediaRouteControllerDialog` | This class implements the route controller dialog for `https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter`. |

*** ** * ** ***

A class that has an `https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcher` that allows you to register a `https://developer.android.com/reference/androidx/activity/OnBackPressedCallback` for handling the system back button.

It is expected that classes that implement this interface route the system back button to the dispatcher

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcher` |   |

## Summary

| ### Public methods |
|---|---|
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcher` | `https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcherOwner#getOnBackPressedDispatcher()()` The `https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcher` that should handle the system back button. |

| ### Inherited methods |
|---|
| From [androidx.lifecycle.LifecycleOwner](https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner) |---|---| | `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/lifecycle/Lifecycle` | `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner#getLifecycle()()` | |

## Public methods

### getOnBackPressedDispatcher

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

```
abstract @NonNull OnBackPressedDispatcher getOnBackPressedDispatcher()
```

The `https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcher` that should handle the system back button.