# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/privacysandbox/sdkruntime/core/activity/ActivityHolder "View this page in Java")

<br />

```
interface ActivityHolder : LifecycleOwner
```

<br />

*** ** * ** ***

| **This interface is deprecated.**   
| This library is no longer supported.

A holder for the[Activity](https://developer.android.com/reference/android/app/Activity.html)created for SDK.

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

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

## Summary

|                                                ### Public functions                                                 |
|---------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Activity](https://developer.android.com/reference/android/app/Activity.html)                                       | ~~[getActivity](https://developer.android.com/reference/kotlin/androidx/privacysandbox/sdkruntime/core/activity/ActivityHolder#getActivity())~~`()` **This function is deprecated.**This library is no longer supported.                               |
| [OnBackPressedDispatcher](https://developer.android.com/reference/kotlin/androidx/activity/OnBackPressedDispatcher) | ~~[getOnBackPressedDispatcher](https://developer.android.com/reference/kotlin/androidx/privacysandbox/sdkruntime/core/activity/ActivityHolder#getOnBackPressedDispatcher())~~`()` **This function is deprecated.**This library is no longer supported. |

|                                                                                                                                                                                                                                                                                                                               ### Inherited properties                                                                                                                                                                                                                                                                                                                                |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.lifecycle.LifecycleOwner](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner) |------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Lifecycle](https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle) | [lifecycle](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner#lifecycle()) **This property is deprecated.**This library is no longer supported. | |

## Public functions

### 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)  

```
fun [getActivity](https://developer.android.com/reference/kotlin/androidx/privacysandbox/sdkruntime/core/activity/ActivityHolder#getActivity())(): Activity
```
| **This function is deprecated.**   
| This library is no longer supported.

The[Activity](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)  

```
fun [getOnBackPressedDispatcher](https://developer.android.com/reference/kotlin/androidx/privacysandbox/sdkruntime/core/activity/ActivityHolder#getOnBackPressedDispatcher())(): OnBackPressedDispatcher
```
| **This function is deprecated.**   
| This library is no longer supported.

The[OnBackPressedDispatcher](https://developer.android.com/reference/kotlin/androidx/activity/OnBackPressedDispatcher)for the created[Activity](https://developer.android.com/reference/android/app/Activity.html).