Android Photo picker set specific mime types

163 Views Asked by At

I'm trying to use the new Photo picker available on Android https://developer.android.com/training/data-storage/shared/photopicker

However, the app has a requirement of only allowing specific image types such as JPG and PNG to be selected by the user and not showing GIFs or other image formats. The photo picker allows selection of only one mime type when it's launched via

val mimeType = "image/gif"
pickMedia.launch(PickVisualMediaRequest(PickVisualMedia.SingleMimeType(mimeType)))

But I need to allow two mime types to be selected (in my case JPG and PNG) Would it be possible to do that?

0

There are 0 best solutions below