2
votes

How can I limit a user from picking an image only from the Gallery (and not from Photos)?

Using the following Intent, the user is presented with a choice of Gallery or Photos from which one can choose a photo. I only want them to pick from the Gallery.

Intent intent = new Intent(
    Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, PHOTO_REQUEST)

I was using the Intent below, but it displayed many more image locations (e.g. Gallery, Photos, Dropbox, OneDrive, ES File Explorer), which is why I used the above Intent--but the above Intent still shows Photos as an option.

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Choose a Photo"), PHOTO_REQUEST);

Just to let you know, my app is set for minimum SDK = 8, with a target of 19.

Custom File Explorer! - Parth Kapoor
@Eu.Dr.: Could you please elaborate on your comment, "Custom File Explorer!", by either presenting an example, link(s), etc. on how this would solve the particular issue? Thanks in advance! - SoCalCoder
Did you find any solution? We are facing same problem... - Aditi Parikh