0

Im pretty sure the issue is thanks to my phone, a couple of my friends have tried the app and they can open the video gallery just fine but when i test it on my Google Pixel XL the "photos" gallery will pop up.

I have 2 buttons, one to open the Photos and the other one for Videos, when i try it on my phone (Google Pixel XL) i still get the photos library no matter where i press.

This is the code im using for the Photos and Videos buttons.

   case IMAGE:
   selectMediaFromGallery("image/*", SnapState.IMAGE.getRequestCode());
   break;
   case VIDEO:
   selectMediaFromGallery("image/* video/*", 
   SnapState.VIDEO.getRequestCode());

I have also tried using this piece of code

   Intent intent = new Intent(Intent.ACTION_PICK, 
   MediaStore.Video.Media.EXTERNAL_CONTENT_URI);

Any advice/help is highly appreciated. I have no idea what to do, maybe its just my phone and the way the gallery is built?

Thank you.

  • What is `selectMediaFromGallery()`? Are you sure that its first parameter expects a space-delimited list of wildcard MIME types? In terms of the second code snippet, how that is handled on a particular device is up to the device manufacturer and user. There may be zero, one, or several activities that can handle that request, and what they display is up to their respective developers. – CommonsWare Aug 04 '19 at 20:35
  • also check you haven't set the photo's app as the default and therefore it won't give you the option of anything else: https://www.makeuseof.com/tag/remove-change-set-default-apps-android/ – Blundell Aug 04 '19 at 21:00
  • You mean this? private void selectMediaFromGallery(String mimeType, int resultCode) { Intent intent = new Intent(Intent.ACTION_PICK); intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, mimeType); startActivityForResult(intent, resultCode); } –  Aug 04 '19 at 21:01

0 Answers0