MediaStore.ActionPickImages Field
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Activity Action: Allow the user to select images or videos provided by system and return it.
[Android.Runtime.Register("ACTION_PICK_IMAGES", ApiSince=33)]
public const string ActionPickImages;
[<Android.Runtime.Register("ACTION_PICK_IMAGES", ApiSince=33)>]
val mutable ActionPickImages : string
Field Value
- Attributes
Remarks
Activity Action: Allow the user to select images or videos provided by system and return it. This is different than Intent#ACTION_PICK
and Intent#ACTION_GET_CONTENT
in that
<ul> <li>the data for this action is provided by the system <li>this action is only used for picking images and videos <li>caller gets read access to user picked items even without storage permissions </ul>
Callers can optionally specify MIME type (such as image/*
or video/*
), resulting in a range of content selection that the caller is interested in. The optional MIME type can be requested with Intent#setType(String)
.
If the caller needs multiple returned items (or caller wants to allow multiple selection), then it can specify MediaStore#EXTRA_PICK_IMAGES_MAX
to indicate this.
When the caller requests multiple selection, the value of MediaStore#EXTRA_PICK_IMAGES_MAX
must be a positive integer greater than 1 and less than or equal to MediaStore#getPickImagesMaxLimit
, otherwise Activity#RESULT_CANCELED
is returned. Use MediaStore#EXTRA_PICK_IMAGES_IN_ORDER
in multiple selection mode to allow the user to pick images in order.
If the caller needs to specify the ApplicationMediaCapabilities
that should be used while picking video files, use MediaStore#EXTRA_MEDIA_CAPABILITIES
to indicate this.
When the requested file format does not match the capabilities specified by caller and the video duration is within the range that the system can handle, it will get transcoded to a default supported format, otherwise, the caller will receive the original file.
Callers may use Intent#EXTRA_LOCAL_ONLY
to limit content selection to local data.
For system stability, it is preferred to open the URIs obtained from using this action by calling MediaStore#openFileDescriptor(ContentResolver, Uri, String, CancellationSignal)
, MediaStore#openAssetFileDescriptor(ContentResolver, Uri, String, CancellationSignal)
or MediaStore#openTypedAssetFileDescriptor(ContentResolver, Uri, String, Bundle, CancellationSignal)
instead of ContentResolver
open APIs.
Output: MediaStore content URI(s) of the item(s) that was picked. Unlike other MediaStore URIs, these are referred to as 'picker' URIs and expose a limited set of read-only operations. Specifically, picker URIs can only be opened for read and queried for columns in PickerMediaColumns
.
Before this API, apps could use Intent#ACTION_GET_CONTENT
. However, #ACTION_PICK_IMAGES
is now the recommended option for images and videos, since it offers a better user experience.
Java documentation for android.provider.MediaStore.ACTION_PICK_IMAGES
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.