MediaStore.ExtraPickImagesSelectionParams 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.
The name of an optional intent-extra used to pass PhotoPickerSelectionParams to the photo picker.
[Android.Runtime.Register("EXTRA_PICK_IMAGES_SELECTION_PARAMS", ApiSince=37)]
public const string ExtraPickImagesSelectionParams;
[<Android.Runtime.Register("EXTRA_PICK_IMAGES_SELECTION_PARAMS", ApiSince=37)>]
val mutable ExtraPickImagesSelectionParams : string
Field Value
- Attributes
Remarks
The name of an optional intent-extra used to pass PhotoPickerSelectionParams to the photo picker. This extra can only be specified in ActionPickImages.
The PhotoPickerSelectionParams object allows the calling app to set constraints on the media items that can be selected by the user. Media items that fail to satisfy these constraints will be disabled for selection.
Without this extra, the photo picker does not apply constraints from selection parameters. Other intent options, such as SetType(String), ExtraMimeTypes, and ExtraLocalOnly, can still filter the available media.
To use this key, calling apps should construct a PhotoPickerSelectionParams object using PhotoPickerSelectionParams.Builder and pass it as the value.
Example: If the calling app wants to allow selection of only those media items that have a maximum size of 10,000 bytes and a minimum resolution of 500 pixels:
PhotoPickerSelectionParams selectionParams = new PhotoPickerSelectionParams.Builder()
.setMaxMediaItemSizeInBytes(10000L)
.setMinMediaItemResolutionInPixels(500L)
.build();
Intent intent = new Intent(MediaStore.ACTION_PICK_IMAGES);
intent.putExtra(MediaStore.EXTRA_PICK_IMAGES_SELECTION_PARAMS, selectionParams);
Android reference for android.provider.MediaStore.EXTRA_PICK_IMAGES_SELECTION_PARAMS.
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.