如何解决错误:必填:图片,找到:图片可打包
当尝试从图库中获取多个选定的图像时,当我使用图像阵列列表时,存在一个兼容的问题,如屏幕截图所示。有什么解决方案?
@Override
protected void onActivityResult(int requestCode,int resultCode,Intent data) {
super.onActivityResult(requestCode,resultCode,data);
if (resultCode != RESULT_OK)
return;
if (requestCode == ConstantsCustomgallery.REQUEST_CODE && resultCode == Activity.RESULT_OK && data != null) {
//The array list has the image paths of the selected images
ArrayList<Image> images = data.getParcelableArrayListExtra(ConstantsCustomgallery.INTENT_EXTRA_IMAGES);
for (int i = 0; i < images.size(); i++) {
Uri uri = Uri.fromFile(new File(images.get(i).path));
// start play with image uri
}
解决方法
正如我在评论中所说,您需要导入正确的Image
。
import in.myinnos.awesomeimagepicker.models.Image;
代替
import android.media.Image;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。