# ActivityResultContracts

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

*** ** * ** ***


```
class ActivityResultContracts
```

<br />

*** ** * ** ***

A collection of some standard activity call contracts, as provided by android.

## Summary

| ### Nested types |
|---|
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.CaptureVideo : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://developer.android.com/reference/android/net/Uri.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to `https://developer.android.com/reference/android/provider/MediaStore.html#ACTION_VIDEO_CAPTURE` saving it into the provided content-`https://developer.android.com/reference/android/net/Uri.html`. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.CreateDocument : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://developer.android.com/reference/android/net/Uri.html?>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to prompt the user to select a path for creating a new document of the given `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.CreateDocument#mimeType()`, returning the `content:` `https://developer.android.com/reference/android/net/Uri.html` of the item that was created. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.GetContent : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://developer.android.com/reference/android/net/Uri.html?>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to prompt the user to pick a piece of content, receiving a `content://` `https://developer.android.com/reference/android/net/Uri.html` for that content that allows you to use `https://developer.android.com/reference/android/content/ContentResolver.html#openInputStream(android.net.Uri)` to access the raw data. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.GetMultipleContents : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html>>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to prompt the user to pick one or more a pieces of content, receiving a `content://` `https://developer.android.com/reference/android/net/Uri.html` for each piece of content that allows you to use `https://developer.android.com/reference/android/content/ContentResolver.html#openInputStream(android.net.Uri)` to access the raw data. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.OpenDocument : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>, https://developer.android.com/reference/android/net/Uri.html?>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to prompt the user to open a document, receiving its contents as a `file:/http:/content:` `https://developer.android.com/reference/android/net/Uri.html`. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.OpenDocumentTree : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://developer.android.com/reference/android/net/Uri.html?, https://developer.android.com/reference/android/net/Uri.html?>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to prompt the user to select a directory, returning the user selection as a `https://developer.android.com/reference/android/net/Uri.html`. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.OpenMultipleDocuments : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html>>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to prompt the user to open (possibly multiple) documents, receiving their contents as `file:/http:/content:` `https://developer.android.com/reference/android/net/Uri.html`s. |
| `class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickContact : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://developer.android.com/reference/java/lang/Void.html?, https://developer.android.com/reference/android/net/Uri.html?>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to request the user to pick a contact from the contacts app. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickMultipleVisualMedia : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://developer.android.com/reference/kotlin/androidx/activity/result/PickVisualMediaRequest, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/net/Uri.html>>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to use the [Photo Picker](https://developer.android.com/training/data-storage/shared/photopicker) to select multiple images, videos, or other types of visual media. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://developer.android.com/reference/kotlin/androidx/activity/result/PickVisualMediaRequest, https://developer.android.com/reference/android/net/Uri.html?>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to use the [Photo Picker](https://developer.android.com/training/data-storage/shared/photopicker) to select a single image, video, or other type of visual media. |
| `abstract class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab` Represents filter input type accepted by the photo picker. |
| `object https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab.AlbumsTab : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab` `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab` object used to open the picker in Albums tab. |
| `object https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab.PhotosTab : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab` `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab` object used to open the picker in Photos tab (also the default if no value is provided). |
| `object https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.ImageAndVideo : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` object used to filter images and video when using the photo picker. |
| `object https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.ImageOnly : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` object used to filter images only when using the photo picker. |
| `class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.MediaCapabilities` Represents the media capabilities of an application. |
| `class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.MediaCapabilities.Builder` A builder for constructing `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.MediaCapabilities` instances. |
| `class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.SingleMimeType : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` class used to filter a single mime type only when using the photo picker. |
| `object https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VideoOnly : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` object used to filter video only when using the photo picker. |
| `sealed interface https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` Represents filter input type accepted by the photo picker. |
| `class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.RequestMultiplePermissions : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html>>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to `https://developer.android.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[], int)` |
| `class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.RequestPermission : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to `https://developer.android.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[], int)` |
| `class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.StartActivityForResult : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://developer.android.com/reference/android/content/Intent.html, https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` that doesn't do any type conversion, taking raw `https://developer.android.com/reference/android/content/Intent.html` as an input and `https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult` as an output. |
| `class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://developer.android.com/reference/kotlin/androidx/activity/result/IntentSenderRequest, https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` that calls `https://developer.android.com/reference/android/app/Activity.html#startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int)`. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.TakePicture : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://developer.android.com/reference/android/net/Uri.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to `https://developer.android.com/reference/android/provider/MediaStore.html#ACTION_IMAGE_CAPTURE` saving it into the provided content-`https://developer.android.com/reference/android/net/Uri.html`. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.TakePicturePreview : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://developer.android.com/reference/java/lang/Void.html?, https://developer.android.com/reference/android/graphics/Bitmap.html?>` An `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract` to `https://developer.android.com/reference/android/provider/MediaStore.html#ACTION_IMAGE_CAPTURE` preview, returning it as a `https://developer.android.com/reference/android/graphics/Bitmap.html`. |
| `open class https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.TakeVideo : https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract<https://developer.android.com/reference/android/net/Uri.html, https://developer.android.com/reference/android/graphics/Bitmap.html?>` **This class is deprecated.** The thumbnail bitmap is rarely returned and is not a good signal to determine whether the video was actually successfully captured. |