# LocalOnBackPressedDispatcherOwner

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

<br />

```
object LocalOnBackPressedDispatcherOwner
```

<br />

*** ** * ** ***

Provides a `https://developer.android.com/reference/kotlin/androidx/activity/OnBackPressedDispatcher` that can be used by Composables hosted in a `https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity`.

## Summary

| ### Public functions |
|---|---|
| `infix https://developer.android.com/reference/kotlin/androidx/compose/runtime/ProvidedValue<https://developer.android.com/reference/kotlin/androidx/activity/OnBackPressedDispatcherOwner?>` | `https://developer.android.com/reference/kotlin/androidx/activity/compose/LocalOnBackPressedDispatcherOwner#provides(androidx.activity.OnBackPressedDispatcherOwner)(dispatcherOwner: https://developer.android.com/reference/kotlin/androidx/activity/OnBackPressedDispatcherOwner)` Associates a `https://developer.android.com/reference/kotlin/androidx/activity/compose/LocalOnBackPressedDispatcherOwner#LocalOnBackPressedDispatcherOwner()` key to a value in a call to `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocalProvider.composable#CompositionLocalProvider(kotlin.Array,kotlin.Function0)`. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/activity/OnBackPressedDispatcherOwner?` | `https://developer.android.com/reference/kotlin/androidx/activity/compose/LocalOnBackPressedDispatcherOwner#current()` Returns current composition local value for the owner or `null` if one has not been provided, one has not been set via `https://developer.android.com/reference/kotlin/androidx/activity/package-summary#(android.view.View).setViewTreeOnBackPressedDispatcherOwner(androidx.activity.OnBackPressedDispatcherOwner)`, nor is one available by looking at the `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#LocalContext()`. |

## Public functions

### provides

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

```
infix fun provides(dispatcherOwner: OnBackPressedDispatcherOwner): ProvidedValue<OnBackPressedDispatcherOwner?>
```

Associates a `https://developer.android.com/reference/kotlin/androidx/activity/compose/LocalOnBackPressedDispatcherOwner#LocalOnBackPressedDispatcherOwner()` key to a value in a call to `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocalProvider.composable#CompositionLocalProvider(kotlin.Array,kotlin.Function0)`.

## Public properties

### current

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

```
val current: OnBackPressedDispatcherOwner?
```

Returns current composition local value for the owner or `null` if one has not been provided, one has not been set via `https://developer.android.com/reference/kotlin/androidx/activity/package-summary#(android.view.View).setViewTreeOnBackPressedDispatcherOwner(androidx.activity.OnBackPressedDispatcherOwner)`, nor is one available by looking at the `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#LocalContext()`.