GetMultipleContents
class GetMultipleContents : ActivityResultContract<String!, MutableList<Uri!>!>
An ActivityResultContract
to prompt the user to pick one or more a pieces of content, receiving a content://
Uri
for each piece of content that allows you to use android.content.ContentResolver#openInputStream(Uri)
to access the raw data. By default, this adds Intent#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 createIntent
if you wish to pass additional extras to the Intent created by super.createIntent()
.
Summary
Public constructors | |
---|---|
<init>() An |
Public methods | |
---|---|
open Intent |
createIntent(@NonNull context: Context, @NonNull input: String) |
ActivityResultContract.SynchronousResult<MutableList<Uri!>!>? |
getSynchronousResult(@NonNull context: Context, @NonNull input: String) |
MutableList<Uri!> |
parseResult(resultCode: Int, @Nullable intent: Intent?) |
Public constructors
<init>
GetMultipleContents()
An ActivityResultContract
to prompt the user to pick one or more a pieces of content, receiving a content://
Uri
for each piece of content that allows you to use android.content.ContentResolver#openInputStream(Uri)
to access the raw data. By default, this adds Intent#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 createIntent
if you wish to pass additional extras to the Intent created by super.createIntent()
.
Public methods
createIntent
@CallSuper @NonNull open fun createIntent(
@NonNull context: Context,
@NonNull input: String
): Intent
getSynchronousResult
@Nullable fun getSynchronousResult(
@NonNull context: Context,
@NonNull input: String
): ActivityResultContract.SynchronousResult<MutableList<Uri!>!>?
parseResult
@NonNull fun parseResult(
resultCode: Int,
@Nullable intent: Intent?
): MutableList<Uri!>