# ActivityHolder

Artifact: [androidx.privacysandbox.sdkruntime:sdkruntime-core](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/sdkruntime/core/activity/ActivityHolder.kt+class:androidx.privacysandbox.sdkruntime.core.activity.ActivityHolder) Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

*** ** * ** ***


```
public interface ActivityHolder extends LifecycleOwner
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
> This library is no longer supported.

A holder for the `https://developer.android.com/reference/android/app/Activity.html` created for SDK.

This is passed to SDKs through `https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/activity/SdkSandboxActivityHandlerCompat#onActivityCreated(androidx.privacysandbox.sdkruntime.core.activity.ActivityHolder)` to notify SDKs about the created `https://developer.android.com/reference/android/app/Activity.html`.

SDK can add `https://developer.android.com/reference/androidx/lifecycle/LifecycleObserver`s into it to observe the `https://developer.android.com/reference/android/app/Activity.html` lifecycle state.

## Summary

| ### Public methods |
|---|---|
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/Activity.html` | `[getActivity](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/activity/ActivityHolder#getActivity())()` **This method is deprecated.** This library is no longer supported. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcher` | `[getOnBackPressedDispatcher](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/activity/ActivityHolder#getOnBackPressedDispatcher())()` **This method is deprecated.** This library is no longer supported. |

| ### 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` | `[getLifecycle](https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner#getLifecycle())()` **This method is deprecated.** This library is no longer supported. | |

## Public methods

### getActivity

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
abstract @NonNull Activity [getActivity](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/activity/ActivityHolder#getActivity())()
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

The `https://developer.android.com/reference/android/app/Activity.html` created for SDK.

### getOnBackPressedDispatcher

Added in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19) Deprecated in [1.0.0-alpha19](https://developer.android.com/jetpack/androidx/releases/privacysandbox-sdkruntime#1.0.0-alpha19)

```
abstract @NonNull OnBackPressedDispatcher [getOnBackPressedDispatcher](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/activity/ActivityHolder#getOnBackPressedDispatcher())()
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

The `https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcher` for the created `https://developer.android.com/reference/android/app/Activity.html`.