0

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:

enter image description here

I assume the main difference is that these folders are created by other apps. How do I make them show up in the picker?

ShahiM
  • 3,179
  • 1
  • 33
  • 58
  • Please post full paths of those folders. – blackapps Jun 26 '23 at 14:40
  • The first 2 albums are not a specific folder. The rest that are visible are in `DCIM/`. The missing folders are from `DCIM/` as well as `Pictures/` – ShahiM Jun 27 '23 at 10:41
  • You have not given full paths of `AdobeLightroom, DCIM, GoPro Exports, Instagram, WhatsApp Images). ` – blackapps Jun 27 '23 at 11:58
  • Those folders are both inside `DCIM/` as well as `Pictures/`. So `DCIM/AdobeLightroom`, `Pictures/Instagram` etc – ShahiM Jun 29 '23 at 11:42
  • Why dont you give full paths of them? How should we know about which DCIM you are talking if you dont give full path. – blackapps Jun 29 '23 at 12:14
  • I don't understand what you mean by full path. is it `Internal Storage/DCIM/GoPro-Exports`? I also don't see how that is relevant to the question. I can give you more info if you can tell me what you're looking for. – ShahiM Jun 29 '23 at 12:19
  • I asked for full [paths. Further i can tell you that pictures taken with Open Camera which are put in /storage/emulated/0/DCIM/OpenCamera are selectable under Photos | Recent. But not under Albums. So yes i believe you when you say that the whole stuff is problematic. Who decided this crappy method? – blackapps Jun 29 '23 at 12:27

0 Answers0