ACTION_OPEN_DOCUMENT constant
Activity Action: Allow the user to select and return one or more existing documents. When invoked, the system will display the various {@link DocumentsProvider} instances installed on the device, letting the user interactively navigate through them. These documents include local media, such as photos and video, and documents provided by installed cloud storage providers.
Each document is represented as a {@code content://} URI backed by a {@link DocumentsProvider}, which can be opened as a stream with {@link ContentResolver#openFileDescriptor(Uri, String)}, or queried for {@link android.provider.DocumentsContract.Document} metadata.
All selected documents are returned to the calling application with persistable read and write permission grants. If you want to maintain access to the documents across device reboots, you need to explicitly take the persistable permissions using {@link ContentResolver#takePersistableUriPermission(Uri, int)}.
Callers must indicate the acceptable document MIME types through {@link #setType(String)}. For example, to select photos, use {@code image/*}. If multiple disjoint MIME types are acceptable, define them in {@link #EXTRA_MIME_TYPES} and {@link #setType(String)} to {@literal *}/*.
If the caller can handle multiple returned items (the user performing multiple selection), then you can specify {@link #EXTRA_ALLOW_MULTIPLE} to indicate this.
Callers must include {@link #CATEGORY_OPENABLE} in the Intent to obtain URIs that can be opened with {@link ContentResolver#openFileDescriptor(Uri, String)}.
Callers can set a document URI through {@link DocumentsContract#EXTRA_INITIAL_URI} to indicate the initial location of documents navigator. System will do its best to launch the navigator in the specified document if it's a folder, or the folder that contains the specified document if not.
Output: The URI of the item that was picked, returned in {@link #getData()}. This must be a {@code content://} URI so that any receiver can access it. If multiple documents were selected, they are returned in {@link #getClipData()}.
@see DocumentsContract @see #ACTION_OPEN_DOCUMENT_TREE @see #ACTION_CREATE_DOCUMENT @see #FLAG_GRANT_PERSISTABLE_URI_PERMISSION
Implementation
static const String ACTION_OPEN_DOCUMENT =
"android.intent.action.OPEN_DOCUMENT";