语言

MediaStore.ExtraPickImagesSelectionParams 字段

定义

用于传递给 PhotoPickerSelectionParams 照片选取器的可选意向附加的名称。

[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

字段值

特性

注解

用于传递给 PhotoPickerSelectionParams 照片选取器的可选意向附加的名称。 此额外功能只能在 . 中 ActionPickImages指定。

该 PhotoPickerSelectionParams 对象允许调用应用对用户可以选择的媒体项设置约束。 无法满足这些约束的媒体项将被禁用以供选择。

如果没有此额外内容,照片选取器不会应用选择参数的约束。 其他意向选项(例如 SetType(String), ExtraMimeTypes和 ExtraLocalOnly)仍可筛选可用的媒体。

若要使用此密钥,调用应用应构造一个 PhotoPickerSelectionParams 对象 PhotoPickerSelectionParams.Builder ,并将其作为值传递。

示例:如果调用应用只允许选择最大大小为 10,000 字节且最小分辨率为 500 像素的媒体项:

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 参考。android.provider.MediaStore.EXTRA_PICK_IMAGES_SELECTION_PARAMS

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于