PhotoPickerSelectionParams
public
final
class
PhotoPickerSelectionParams
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.widget.photopicker.PhotoPickerSelectionParams |
An immutable parcel that carries constraints to be applied to media items displayed in the Photo Picker.
Media items that fail to satisfy these constraints will be disabled for selection.
Callers should use Builder to construct an instance of this class.
Summary
Nested classes | |
|---|---|
class |
PhotoPickerSelectionParams.Builder
A builder class used to construct and validate an immutable
|
Inherited constants |
|---|
Fields | |
|---|---|
public
static
final
Creator<PhotoPickerSelectionParams> |
CREATOR
|
Public methods | |
|---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
long
|
getMaxMediaItemResolutionInPixels()
Returns the maximum allowed resolution, in pixels, for a media item to be selectable. |
long
|
getMaxMediaItemSizeInBytes()
Returns the maximum allowed size, in bytes, for a media item to be selectable. |
long
|
getMaxSelectionBatchSizeInBytes()
Returns the maximum allowed cumulative size, in bytes, for the entire batch of selected media items. |
Duration
|
getMaxVideoDuration()
Returns the maximum allowed duration for a video to be selectable. |
List<String>
|
getMimeTypes()
Returns the list of allowed MIME types that media items must match to be selectable. |
long
|
getMinMediaItemResolutionInPixels()
Returns the minimum required resolution, in pixels, for a media item to be selectable. |
Duration
|
getMinVideoDuration()
Returns the minimum required duration for a video to be selectable. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
|---|---|
Fields
CREATOR
public static final Creator<PhotoPickerSelectionParams> CREATOR
Public methods
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(Parcel,int),
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or
|
getMaxMediaItemResolutionInPixels
public long getMaxMediaItemResolutionInPixels ()
Returns the maximum allowed resolution, in pixels, for a media item to be selectable.
If the maximum resolution is not set by the caller app using Builder.setMaxMediaItemResolutionInPixels(long), this method returns -1, indicating that the
photo picker will not restrict selection based on the maximum media item resolution.
| Returns | |
|---|---|
long |
|
getMaxMediaItemSizeInBytes
public long getMaxMediaItemSizeInBytes ()
Returns the maximum allowed size, in bytes, for a media item to be selectable.
If the maximum media item size is not set by the caller app using Builder.setMaxMediaItemSizeInBytes(long), this method returns -1, indicating that the
photo picker will not restrict selection based on the maximum media item size.
| Returns | |
|---|---|
long |
|
getMaxSelectionBatchSizeInBytes
public long getMaxSelectionBatchSizeInBytes ()
Returns the maximum allowed cumulative size, in bytes, for the entire batch of selected media items.
If the maximum selection batch size is not set by the caller app using Builder.setMaxSelectionBatchSizeInBytes(long), this method returns -1, indicating that the
photo picker will not restrict selection based on the total batch size.
| Returns | |
|---|---|
long |
|
getMaxVideoDuration
public Duration getMaxVideoDuration ()
Returns the maximum allowed duration for a video to be selectable.
If the maximum video duration is not set by the caller app using Builder.setMaxVideoDuration(Duration), this method returns null,
indicating that the photo picker will not restrict selection based on the maximum video
duration.
| Returns | |
|---|---|
Duration |
|
getMimeTypes
public List<String> getMimeTypes ()
Returns the list of allowed MIME types that media items must match to be selectable.
If the allowed MIME types are not set by the caller app using Builder.setMimeTypes(List), this method returns an empty list, indicating that the
photo picker will not restrict selection based on the MIME type.
| Returns | |
|---|---|
List<String> |
This value cannot be null. |
getMinMediaItemResolutionInPixels
public long getMinMediaItemResolutionInPixels ()
Returns the minimum required resolution, in pixels, for a media item to be selectable.
If the minimum resolution is not set by the caller app using Builder.setMinMediaItemResolutionInPixels(long), this method returns -1, indicating that the
photo picker will not restrict selection based on the minimum media item resolution.
| Returns | |
|---|---|
long |
|
getMinVideoDuration
public Duration getMinVideoDuration ()
Returns the minimum required duration for a video to be selectable.
If the minimum video duration is not set by the caller app using Builder.setMinVideoDuration(Duration), this method returns null,
indicating that the photo picker will not restrict selection based on the minimum video
duration.
| Returns | |
|---|---|
Duration |
|
writeToParcel
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: This value cannot be null. |
flags |
int: Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-03-26 UTC.