# ActivityResultCaller

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

*** ** * ** ***

<br />

```
interface ActivityResultCaller
```

<br />

Known direct subclasses [ComponentActivity](https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity), [Fragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/activity/ComponentActivity` | Base class for activities that enables composition of higher level components. |
| `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment` | Static library support version of the framework's `https://developer.android.com/reference/android/app/Fragment.html`. |

Known indirect subclasses [AbstractListDetailFragment](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/AbstractListDetailFragment), [AbstractProgressFragment](https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/fragment/ui/AbstractProgressFragment), [AmbientModeSupport](https://developer.android.com/reference/kotlin/androidx/wear/ambient/AmbientModeSupport), [AppCompatActivity](https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatActivity), [AppCompatDialogFragment](https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatDialogFragment), [BaseCarAppActivity](https://developer.android.com/reference/kotlin/androidx/car/app/activity/BaseCarAppActivity), [BaseLeanbackPreferenceFragmentCompat](https://developer.android.com/reference/kotlin/androidx/leanback/preference/BaseLeanbackPreferenceFragmentCompat), [BaseSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/BaseSupportFragment), [BrandedSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/BrandedSupportFragment), [BrowseSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/BrowseSupportFragment), [CarAppActivity](https://developer.android.com/reference/kotlin/androidx/car/app/activity/CarAppActivity), [ComposableFragment](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragment), [ComposableNavHostFragment](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableNavHostFragment), [DefaultProgressFragment](https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/fragment/ui/DefaultProgressFragment), [DetailsSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/DetailsSupportFragment), [DialogFragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/DialogFragment), [DynamicNavHostFragment](https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/fragment/DynamicNavHostFragment), [EditTextPreferenceDialogFragmentCompat](https://developer.android.com/reference/kotlin/androidx/preference/EditTextPreferenceDialogFragmentCompat), [EditablePdfViewerFragment](https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment), [ErrorSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/ErrorSupportFragment), [FragmentActivity](https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentActivity), [GuidedStepSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/GuidedStepSupportFragment), [HeadersSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/HeadersSupportFragment), [LauncherActivity](https://developer.android.com/reference/kotlin/androidx/car/app/activity/LauncherActivity), [LeanbackEditTextPreferenceDialogFragmentCompat](https://developer.android.com/reference/kotlin/androidx/leanback/preference/LeanbackEditTextPreferenceDialogFragmentCompat), [LeanbackListPreferenceDialogFragmentCompat](https://developer.android.com/reference/kotlin/androidx/leanback/preference/LeanbackListPreferenceDialogFragmentCompat), [LeanbackPreferenceDialogFragmentCompat](https://developer.android.com/reference/kotlin/androidx/leanback/preference/LeanbackPreferenceDialogFragmentCompat), [LeanbackPreferenceFragmentCompat](https://developer.android.com/reference/kotlin/androidx/leanback/preference/LeanbackPreferenceFragmentCompat), [LeanbackSettingsFragmentCompat](https://developer.android.com/reference/kotlin/androidx/leanback/preference/LeanbackSettingsFragmentCompat), [ListFragment](https://developer.android.com/reference/kotlin/androidx/fragment/app/ListFragment), [ListPreferenceDialogFragmentCompat](https://developer.android.com/reference/kotlin/androidx/preference/ListPreferenceDialogFragmentCompat), [MediaRouteChooserDialogFragment](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteChooserDialogFragment), [MediaRouteControllerDialogFragment](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteControllerDialogFragment), [MediaRouteDiscoveryFragment](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteDiscoveryFragment), [MultiSelectListPreferenceDialogFragmentCompat](https://developer.android.com/reference/kotlin/androidx/preference/MultiSelectListPreferenceDialogFragmentCompat), [NavHostFragment](https://developer.android.com/reference/kotlin/androidx/navigation/fragment/NavHostFragment), [OnboardingSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/OnboardingSupportFragment), [PdfViewerFragment](https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment), [PlaybackSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/PlaybackSupportFragment), [PreferenceDialogFragmentCompat](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDialogFragmentCompat), [PreferenceFragmentCompat](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragmentCompat), [PreferenceHeaderFragmentCompat](https://developer.android.com/reference/kotlin/androidx/preference/PreferenceHeaderFragmentCompat), [PreviewActivity](https://developer.android.com/reference/kotlin/androidx/compose/ui/tooling/PreviewActivity), [RowsSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/RowsSupportFragment), [SearchSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/SearchSupportFragment), [VerticalGridSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/VerticalGridSupportFragment), [VideoSupportFragment](https://developer.android.com/reference/kotlin/androidx/leanback/app/VideoSupportFragment)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/AbstractListDetailFragment` | A fragment supports adaptive two-pane layout. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/fragment/ui/AbstractProgressFragment` | The base class for `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment`s that handle dynamic feature installation. |
| `https://developer.android.com/reference/kotlin/androidx/wear/ambient/AmbientModeSupport` | **This class is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/wear/ambient/AmbientLifecycleObserver` instead. <br /> |
| `https://developer.android.com/reference/kotlin/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/kotlin/androidx/appcompat/app/AppCompatDialogFragment` | A special version of `https://developer.android.com/reference/kotlin/androidx/fragment/app/DialogFragment` which uses an `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatDialog` in place of a platform-styled dialog. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/activity/BaseCarAppActivity` | Core logic for CarAppLibrary Activity interaction with a host. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/preference/BaseLeanbackPreferenceFragmentCompat` | This fragment provides a preference fragment with leanback-style behavior, suitable for embedding into broader UI elements. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/BaseSupportFragment` | Base class for leanback Fragments. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/BrandedSupportFragment` | Fragment class for managing search and branding using a view that implements `https://developer.android.com/reference/kotlin/androidx/leanback/widget/TitleViewAdapter.Provider`. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/BrowseSupportFragment` | A fragment for creating Leanback browse screens. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/activity/CarAppActivity` | The class representing a car app activity in the main display. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragment` | This class provides a `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment` wrapper around a composable function that is loaded via reflection. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableNavHostFragment` | A `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/NavHostFragment` that adds support for `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragment` instances via `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/compose/ComposableFragmentNavigator`. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/fragment/ui/DefaultProgressFragment` | The default `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment` to display during installation progress. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/DetailsSupportFragment` | A fragment for creating Leanback details screens. |
| `https://developer.android.com/reference/kotlin/androidx/fragment/app/DialogFragment` | A fragment that displays a dialog window, floating in the foreground of its activity's window. |
| `https://developer.android.com/reference/kotlin/androidx/navigation/dynamicfeatures/fragment/DynamicNavHostFragment` | The `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/NavHostFragment` for dynamic features. |
| `https://developer.android.com/reference/kotlin/androidx/preference/EditTextPreferenceDialogFragmentCompat` |   |
| `https://developer.android.com/reference/kotlin/androidx/pdf/ink/EditablePdfViewerFragment` | A `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment` that extends `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment` to provide PDF editing capabilities, including annotation and form filling, leveraging the 'androidx.ink' library. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/ErrorSupportFragment` | A fragment for displaying an error indication. |
| `https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentActivity` | Base class for activities that want to use the support-based `https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment`. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/GuidedStepSupportFragment` | A GuidedStepSupportFragment is used to guide the user through a decision or series of decisions. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/HeadersSupportFragment` | An fragment containing a list of row headers. |
| `https://developer.android.com/reference/kotlin/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/kotlin/androidx/leanback/preference/LeanbackEditTextPreferenceDialogFragmentCompat` | Implemented a dialog to input text. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/preference/LeanbackListPreferenceDialogFragmentCompat` | Implemented a dialog to show `https://developer.android.com/reference/kotlin/androidx/preference/ListPreference` or `https://developer.android.com/reference/kotlin/androidx/preference/MultiSelectListPreference`. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/preference/LeanbackPreferenceDialogFragmentCompat` | A fragment that shows `https://developer.android.com/reference/kotlin/androidx/preference/DialogPreference`, for example `https://developer.android.com/reference/kotlin/androidx/preference/ListPreference` or `https://developer.android.com/reference/kotlin/androidx/preference/MultiSelectListPreference`. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/preference/LeanbackPreferenceFragmentCompat` | This fragment provides a fully decorated leanback-style preference fragment, including a list background and header. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/preference/LeanbackSettingsFragmentCompat` | This fragment provides a container for displaying a `https://developer.android.com/reference/kotlin/androidx/leanback/preference/LeanbackPreferenceFragmentCompat` |
| `https://developer.android.com/reference/kotlin/androidx/fragment/app/ListFragment` | Static library support version of the framework's `https://developer.android.com/reference/android/app/ListFragment.html`. |
| `https://developer.android.com/reference/kotlin/androidx/preference/ListPreferenceDialogFragmentCompat` |   |
| `https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteChooserDialogFragment` | Media route chooser dialog fragment. |
| `https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteControllerDialogFragment` | Media route controller dialog fragment. |
| `https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteDiscoveryFragment` | Media route discovery fragment. |
| `https://developer.android.com/reference/kotlin/androidx/preference/MultiSelectListPreferenceDialogFragmentCompat` |   |
| `https://developer.android.com/reference/kotlin/androidx/navigation/fragment/NavHostFragment` | NavHostFragment provides an area within your layout for self-contained navigation to occur. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/OnboardingSupportFragment` | An OnboardingSupportFragment provides a common and simple way to build onboarding screen for applications. |
| `https://developer.android.com/reference/kotlin/androidx/pdf/viewer/fragment/PdfViewerFragment` | A Fragment that renders a PDF document. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/PlaybackSupportFragment` | A fragment for displaying playback controls and related content. |
| `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceDialogFragmentCompat` | Abstract base class which presents a dialog associated with a `https://developer.android.com/reference/kotlin/androidx/preference/DialogPreference`. |
| `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceFragmentCompat` | A PreferenceFragmentCompat is the entry point to using the Preference library. |
| `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceHeaderFragmentCompat` | `https://developer.android.com/reference/kotlin/androidx/preference/PreferenceHeaderFragmentCompat` implements a two-pane fragment for preferences. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/tooling/PreviewActivity` | Activity used to run `@Composable` previews from Android Studio. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/RowsSupportFragment` | An ordered set of rows of leanback widgets. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/SearchSupportFragment` | A fragment to handle searches. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/VerticalGridSupportFragment` | A fragment for creating leanback vertical grids. |
| `https://developer.android.com/reference/kotlin/androidx/leanback/app/VideoSupportFragment` | Subclass of `https://developer.android.com/reference/kotlin/androidx/leanback/app/PlaybackSupportFragment` that is responsible for providing a `https://developer.android.com/reference/android/view/SurfaceView.html` and rendering video. |

*** ** * ** ***

A class that can call `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`-style APIs without having to manage request codes, and converting request/response to an `https://developer.android.com/reference/android/content/Intent.html`

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultLauncher<I>` | `<I : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, O : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract,androidx.activity.result.ActivityResultCallback)( contract: https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<I, O>, callback: https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCallback<O> )` Register a request to `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`, designated by the given `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract`. |
| `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultLauncher<I>` | `<I : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, O : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract,androidx.activity.result.ActivityResultRegistry,androidx.activity.result.ActivityResultCallback)( contract: https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<I, O>, registry: https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultRegistry, callback: https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCallback<O> )` Register a request to `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`, designated by the given `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract`. |

| ### Extension functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultLauncher<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>` | `<I : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, O : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller.https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller#(androidx.activity.result.ActivityResultCaller).registerForActivityResult(androidx.activity.result.contract.ActivityResultContract,kotlin.Any,kotlin.Function1)( contract: https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<I, O>, input: I, callback: (O) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` A version of `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract,androidx.activity.result.ActivityResultCallback)` that additionally takes an input right away, producing a launcher that doesn't take any additional input when called. |
| `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultLauncher<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>` | `<I : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, O : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller.https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller#(androidx.activity.result.ActivityResultCaller).registerForActivityResult(androidx.activity.result.contract.ActivityResultContract,kotlin.Any,androidx.activity.result.ActivityResultRegistry,kotlin.Function1)( contract: https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<I, O>, input: I, registry: https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultRegistry, callback: (O) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` A version of `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract,androidx.activity.result.ActivityResultCallback)` that additionally takes an input right away, producing a launcher that doesn't take any additional input when called. |

## Public functions

### registerForActivityResult

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

```
fun <I : Any?, O : Any?> registerForActivityResult(
    contract: ActivityResultContract<I, O>,
    callback: ActivityResultCallback<O>
): ActivityResultLauncher<I>
```

Register a request to `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`, designated by the given `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract`.

This creates a record in the `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultRegistry` associated with this caller, managing request code, as well as conversions to/from `https://developer.android.com/reference/android/content/Intent.html` under the hood.

This *must* be called unconditionally, as part of initialization path, typically as a field initializer of an Activity or Fragment.

| Parameters |
|---|---|
| `<I : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>` | the type of the input(if any) required to call the activity |
| `<O : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>` | the type of output returned as an activity result |
| `contract: https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<I, O>` | the contract, specifying conversions to/from `https://developer.android.com/reference/android/content/Intent.html`s |
| `callback: https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCallback<O>` | the callback to be called on the main thread when activity result is available |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultLauncher<I>` | the launcher that can be used to start the activity or dispose of the prepared call. |

### registerForActivityResult

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

```
fun <I : Any?, O : Any?> registerForActivityResult(
    contract: ActivityResultContract<I, O>,
    registry: ActivityResultRegistry,
    callback: ActivityResultCallback<O>
): ActivityResultLauncher<I>
```

Register a request to `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`, designated by the given `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract`.

This creates a record in the given `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultRegistry`, managing request code, as well as conversions to/from `https://developer.android.com/reference/android/content/Intent.html` under the hood.

This *must* be called unconditionally, as part of initialization path, typically as a field initializer of an Activity or Fragment.

| Parameters |
|---|---|
| `<I : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>` | the type of the input(if any) required to call the activity |
| `<O : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>` | the type of output returned as an activity result |
| `contract: https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<I, O>` | the contract, specifying conversions to/from `https://developer.android.com/reference/android/content/Intent.html`s |
| `registry: https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultRegistry` | the registry where to hold the record. |
| `callback: https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCallback<O>` | the callback to be called on the main thread when activity result is available |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultLauncher<I>` | the launcher that can be used to start the activity or dispose of the prepared call. |

## Extension functions

### ActivityResultCaller.registerForActivityResult

Artifact: [androidx.activity:activity](https://developer.android.com/jetpack/androidx/releases/activity) [View Source](https://cs.android.com/search?q=file:androidx/activity/result/ActivityResultCaller.kt+function:registerForActivityResult)

```
fun <I : Any?, O : Any?> ActivityResultCaller.registerForActivityResult(
    contract: ActivityResultContract<I, O>,
    input: I,
    callback: (O) -> Unit
): ActivityResultLauncher<Unit>
```

A version of `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract,androidx.activity.result.ActivityResultCallback)` that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract,androidx.activity.result.ActivityResultCallback)` |   |

### ActivityResultCaller.registerForActivityResult

Artifact: [androidx.activity:activity](https://developer.android.com/jetpack/androidx/releases/activity) [View Source](https://cs.android.com/search?q=file:androidx/activity/result/ActivityResultCaller.kt+function:registerForActivityResult)

```
fun <I : Any?, O : Any?> ActivityResultCaller.registerForActivityResult(
    contract: ActivityResultContract<I, O>,
    input: I,
    registry: ActivityResultRegistry,
    callback: (O) -> Unit
): ActivityResultLauncher<Unit>
```

A version of `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract,androidx.activity.result.ActivityResultCallback)` that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller#registerForActivityResult(androidx.activity.result.contract.ActivityResultContract,androidx.activity.result.ActivityResultCallback)` |   |