# ActivityResultContracts.GetMultipleContents

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.GetMultipleContents) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/activity#1.2.0)

*** ** * ** ***


```
public class ActivityResultContracts.GetMultipleContents extends ActivityResultContract<@NonNull String, @NonNull List<@NonNull Uri>>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.activity.result.contract.ActivityResultContract](https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) [String](https://developer.android.com/reference/java/lang/String.html), @[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) [List](https://developer.android.com/reference/java/util/List.html)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) [Uri](https://developer.android.com/reference/android/net/Uri.html)\>\> ||
|   | ↳ | [androidx.activity.result.contract.ActivityResultContracts.GetMultipleContents](https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.GetMultipleContents) |

*** ** * ** ***

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. By default, this adds `https://developer.android.com/reference/android/content/Intent.html#CATEGORY_OPENABLE` to only return content that can be represented as a stream.

The input is the mime type to filter by, e.g. `image/\*`.

This can be extended to override `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.GetMultipleContents#createIntent(android.content.Context,kotlin.String)` if you wish to pass additional extras to the Intent created by `super.createIntent()`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.GetMultipleContents#GetMultipleContents()()` |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html` | `@https://developer.android.com/reference/androidx/annotation/CallSuper https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.GetMultipleContents#createIntent(android.content.Context,kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html input)` Create an intent that can be used for `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`. |
| `final https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract.SynchronousResult<@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>>` | `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.GetMultipleContents#getSynchronousResult(android.content.Context,kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html input)` An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity. |
| `final @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>` | `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.GetMultipleContents#parseResult(kotlin.Int,android.content.Intent)(int resultCode, https://developer.android.com/reference/android/content/Intent.html intent)` Convert result obtained from `https://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)` to `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract`. |

## Public constructors

### GetMultipleContents

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

```
public GetMultipleContents()
```

## Public methods

### createIntent

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

```
@CallSuper
public @NonNull Intent createIntent(@NonNull Context context, @NonNull String input)
```

Create an intent that can be used for `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`.

### getSynchronousResult

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

```
public final ActivityResultContract.SynchronousResult<@NonNull List<@NonNull Uri>> getSynchronousResult(@NonNull Context context, @NonNull String input)
```

An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract.SynchronousResult<@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>>` | the result wrapped in a `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract.SynchronousResult` or `null` if the call should proceed to start an activity. |

### parseResult

```
public final @NonNull List<@NonNull Uri> parseResult(int resultCode, Intent intent)
```

Convert result obtained from `https://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)` to `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract`.