# SdkActivityLaunchers

Added in 1.0.0-alpha03 Deprecated in 1.0.0-alpha03

*** ** * ** ***


```
public final class SdkActivityLaunchers
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/activity/client/LocalManagedSdkActivityLauncher<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | `<T extends https://developer.android.com/reference/android/app/Activity.html & https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner> [createManagedSdkActivityLauncher](https://developer.android.com/reference/androidx/privacysandbox/activity/client/SdkActivityLaunchers#(android.app.Activity).createManagedSdkActivityLauncher(kotlin.Function0))( @https://developer.android.com/reference/androidx/annotation/NonNull T receiver, @https://developer.android.com/reference/androidx/annotation/NonNull Function0<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> allowLaunch )` **This method is deprecated.** This library is no longer supported. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/activity/client/LocalUnmanagedSdkActivityLauncher<@https://developer.android.com/reference/androidx/annotation/NonNull T>` | `<T extends https://developer.android.com/reference/android/app/Activity.html> [createUnmanagedSdkActivityLauncher](https://developer.android.com/reference/androidx/privacysandbox/activity/client/SdkActivityLaunchers#(android.app.Activity).createUnmanagedSdkActivityLauncher(kotlin.Function0))( @https://developer.android.com/reference/androidx/annotation/NonNull T receiver, @https://developer.android.com/reference/androidx/annotation/NonNull Function0<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> allowLaunch )` **This method is deprecated.** This library is no longer supported. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html` | `[toLauncherInfo](https://developer.android.com/reference/androidx/privacysandbox/activity/client/SdkActivityLaunchers#(androidx.privacysandbox.activity.core.SdkActivityLauncher).toLauncherInfo())(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/activity/core/SdkActivityLauncher receiver)` **This method is deprecated.** This library is no longer supported. |

## Public methods

### createManagedSdkActivityLauncher

Artifact: [androidx.privacysandbox.activity:activity-client](https://developer.android.com/jetpack/androidx/releases/privacysandbox-activity) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/activity/client/SdkActivityLaunchers.kt+function:createManagedSdkActivityLauncher) Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/privacysandbox-activity#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/privacysandbox-activity#1.0.0-alpha03)

```
public static final @NonNull LocalManagedSdkActivityLauncher<@NonNull T> <T extends Activity & LifecycleOwner> [createManagedSdkActivityLauncher](https://developer.android.com/reference/androidx/privacysandbox/activity/client/SdkActivityLaunchers#(android.app.Activity).createManagedSdkActivityLauncher(kotlin.Function0))(
    @NonNull T receiver,
    @NonNull Function0<@NonNull Boolean> allowLaunch
)
```

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

Returns a lifecycle-aware SdkActivityLauncher that launches activities on behalf of an SDK by using this activity as a starting context. The created launcher will be automatically disposed when the current activity is destroyed, with no additional work required.

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/android/app/Activity.html & https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner>` | the current `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner` activity from which new SDK activities will be launched. If this activity is destroyed, any further SDK activity launches will simply be ignored, and `https://developer.android.com/reference/androidx/privacysandbox/activity/client/LocalManagedSdkActivityLauncher#launchSdkActivity(android.os.IBinder)` will return 'false'. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function0<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> allowLaunch` | predicate called each time an activity is about to be launched by the SDK, the activity will only be launched if it returns true. |

### createUnmanagedSdkActivityLauncher

Artifact: [androidx.privacysandbox.activity:activity-client](https://developer.android.com/jetpack/androidx/releases/privacysandbox-activity) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/activity/client/SdkActivityLaunchers.kt+function:createUnmanagedSdkActivityLauncher) Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/privacysandbox-activity#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/privacysandbox-activity#1.0.0-alpha03)

```
public static final @NonNull LocalUnmanagedSdkActivityLauncher<@NonNull T> <T extends Activity> [createUnmanagedSdkActivityLauncher](https://developer.android.com/reference/androidx/privacysandbox/activity/client/SdkActivityLaunchers#(android.app.Activity).createUnmanagedSdkActivityLauncher(kotlin.Function0))(
    @NonNull T receiver,
    @NonNull Function0<@NonNull Boolean> allowLaunch
)
```

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

Returns a lifecycle-unaware SdkActivityLauncher that launches activities on behalf of an SDK by using this activity as a starting context. The created launcher will need to be manually disposed explicitly by the caller.

It is recommended to use a lifecycle-aware launcher created using `https://developer.android.com/reference/androidx/privacysandbox/activity/client/package-summary#(android.app.Activity).createManagedSdkActivityLauncher(kotlin.Function0)` instead. It is automatically disposed when the current activity is destroyed, making it less prone to memory leaks.

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/android/app/Activity.html>` | the current activity from which new SDK activities will be launched. If this activity is destroyed any further SDK activity launches will simply be ignored, and `https://developer.android.com/reference/androidx/privacysandbox/activity/client/LocalUnmanagedSdkActivityLauncher#launchSdkActivity(android.os.IBinder)` will return 'false'. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function0<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html> allowLaunch` | predicate called each time an activity is about to be launched by the SDK, the activity will only be launched if it returns true. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/privacysandbox/activity/client/package-summary#(android.app.Activity).createManagedSdkActivityLauncher(kotlin.Function0)` |   |

### toLauncherInfo

Artifact: [androidx.privacysandbox.activity:activity-client](https://developer.android.com/jetpack/androidx/releases/privacysandbox-activity) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/activity/client/SdkActivityLaunchers.kt+function:toLauncherInfo) Added in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/privacysandbox-activity#1.0.0-alpha03) Deprecated in [1.0.0-alpha03](https://developer.android.com/jetpack/androidx/releases/privacysandbox-activity#1.0.0-alpha03)

```
public static final @NonNull Bundle [toLauncherInfo](https://developer.android.com/reference/androidx/privacysandbox/activity/client/SdkActivityLaunchers#(androidx.privacysandbox.activity.core.SdkActivityLauncher).toLauncherInfo())(@NonNull SdkActivityLauncher receiver)
```

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

Returns a `https://developer.android.com/reference/android/os/Bundle.html` with the information necessary to recreate this launcher. Possibly in a different process.