android 单选图像选择器
我想使用图库图像选择器来选择单个图像。我做了类似的事情,
Intent intent = new Intent(Intent.ACTION_PICK, Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, 0);
这本质上是有效的,但是如果用户在选择器中长按,他们就会进入多选模式。首先,我不希望他们选择多个图像,但即使我这样做了,他们也会被卡住,因为在此模式下无法“提交”选择。
如果我可以限制为单一选择,或者能够正确恢复多值选择,我会很高兴。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来这是不可能的。我们最终构建了自己的图像选择器。
Looks like this is not possible. We ended up building our own image picker.