Search code examples
androidandroid-intentandroid-gallery

android single-select image picker


I'd like to use the gallery image picker to select a single image. I do something like,

Intent intent = new Intent(Intent.ACTION_PICK, Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, 0);

this works essentially, but if the user long-presses in the chooser, they enter multi select mode. first, I don't want them to select multiple images, but even if I did, they are stuck, because there's no way to "submit" the selection when in this mode.

I'd be happy if i could limit to single selection, or be able to get the multi-valued selection back correctly.


Solution

  • Looks like this is not possible. We ended up building our own image picker.