Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

OpenDocument

class OpenDocument : ActivityResultContract<Array<String!>!, Uri!>
kotlin.Any
   ↳ androidx.activity.result.contract.ActivityResultContract<kotlin.Array<kotlin.String>, android.net.Uri>
   ↳ androidx.activity.result.contract.ActivityResultContracts.OpenDocument

An ActivityResultContract to prompt the user to open a document, receiving its contents as a file:/http:/content: Uri.

The input is the mime types 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

An ActivityResultContract to prompt the user to open a document, receiving its contents as a file:/http:/content: Uri.

Public methods
open Intent
createIntent(@NonNull context: Context, @NonNull input: Array<String!>)

ActivityResultContract.SynchronousResult<Uri!>?
getSynchronousResult(@NonNull context: Context, @NonNull input: Array<String!>)

Uri?
parseResult(resultCode: Int, @Nullable intent: Intent?)

Public constructors

<init>

OpenDocument()

An ActivityResultContract to prompt the user to open a document, receiving its contents as a file:/http:/content: Uri.

The input is the mime types 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: Array<String!>
): Intent

getSynchronousResult

@Nullable fun getSynchronousResult(
    @NonNull context: Context,
    @NonNull input: Array<String!>
): ActivityResultContract.SynchronousResult<Uri!>?

parseResult

@Nullable fun parseResult(
    resultCode: Int,
    @Nullable intent: Intent?
): Uri?