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

*** ** * ** ***


```
public final class ActivityResultContracts
```

<br />

*** ** * ** ***

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

## Summary

| ### Nested types |
|---|
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.CaptureVideo extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html>` An `https://developer.android.com/reference/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`. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.CreateDocument extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/android/net/Uri.html>` An `https://developer.android.com/reference/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/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. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.GetContent extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/android/net/Uri.html>` An `https://developer.android.com/reference/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. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.GetMultipleContents extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html>>` An `https://developer.android.com/reference/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. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.OpenDocument extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull String[], https://developer.android.com/reference/android/net/Uri.html>` An `https://developer.android.com/reference/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`. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.OpenDocumentTree extends https://developer.android.com/reference/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/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`. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.OpenMultipleDocuments extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull String[], @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html>>` An `https://developer.android.com/reference/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. |
| `public final class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickContact extends https://developer.android.com/reference/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/androidx/activity/result/contract/ActivityResultContract` to request the user to pick a contact from the contacts app. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickMultipleVisualMedia extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/result/PickVisualMediaRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html>>` An `https://developer.android.com/reference/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. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/result/PickVisualMediaRequest, https://developer.android.com/reference/android/net/Uri.html>` An `https://developer.android.com/reference/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. |
| `public abstract class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab` Represents filter input type accepted by the photo picker. |
| `public static class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab.AlbumsTab extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab` `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab` object used to open the picker in Albums tab. |
| `public static class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab.PhotosTab extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab` `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.DefaultTab` object used to open the picker in Photos tab (also the default if no value is provided). |
| `public static class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.ImageAndVideo implements https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` object used to filter images and video when using the photo picker. |
| `public static class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.ImageOnly implements https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` object used to filter images only when using the photo picker. |
| `public final class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.MediaCapabilities` Represents the media capabilities of an application. |
| `public final class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.MediaCapabilities.Builder` A builder for constructing `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.MediaCapabilities` instances. |
| `public final class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.SingleMimeType implements https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` class used to filter a single mime type only when using the photo picker. |
| `public static class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VideoOnly implements https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` object used to filter video only when using the photo picker. |
| `public sealed interface https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.PickVisualMedia.VisualMediaType` Represents filter input type accepted by the photo picker. |
| `public final class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.RequestMultiplePermissions extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull String[], @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html>>` An `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` to `https://developer.android.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[], int)` |
| `public final class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.RequestPermission extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html>` An `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` to `https://developer.android.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[], int)` |
| `public final class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartActivityForResult extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/result/ActivityResult>` An `https://developer.android.com/reference/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/androidx/activity/result/ActivityResult` as an output. |
| `public final class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/result/IntentSenderRequest, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/result/ActivityResult>` An `https://developer.android.com/reference/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)`. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.TakePicture extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/net/Uri.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Boolean.html>` An `https://developer.android.com/reference/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`. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.TakePicturePreview extends https://developer.android.com/reference/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/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`. |
| `public class https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.TakeVideo extends https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract<@https://developer.android.com/reference/androidx/annotation/NonNull 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. |