Reputation: 3268
I am trying to use the new PhotoPicker to pick an image/video from the gallery:
private val selectImageOrVideoFromGalleryResult =
registerForActivityResult(ActivityResultContracts.PickVisualMedia()) { uri: Uri? ->
uri?.let {
viewModel.addMedia(uri)
}
}
private fun selectMediaFromGallery() = selectImageOrVideoFromGalleryResult.launch(
PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageAndVideo))
The code works as intended, but the issue is that only files from these folders are visible: Videos
, Camera
, Screenshots
, Downloads
I do have other folders in my gallery though (eg. AdobeLightroom
, DCIM
, GoPro Exports
, Instagram
, WhatsApp Images
). But none of these show up in the picker:
I assume the main difference is that these folders are created by other apps. How do I make them show up in the picker?
Upvotes: 3
Views: 733