Error: Required: Image, Found:Image & Parcelable

Error: Required: Image, Found:Image & Parcelable

在尝试从图库中获取多个选定图像时,当我使用图像数组列表时出现了一个兼容问题,如屏幕截图所示。可能的解决方案是什么?

 @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;