将手机相册中的图像加载到ImageView中无效

时间:2016-02-05 19:49:27

标签: android android-imageview

我正在尝试将手机相册中的图片加载到ImageView中。这是我的代码:

Intent intent = getIntent();
            filename = intent.getExtras().getString("file");
            assert filename != null;
            File f = new File(filename);

            Picasso.with(AddCaptionActivity.this)
                    .load(f)
                    .into(image);

在大多数Android手机上运行此代码完全正常。但是在运行Android 6的一部Android One手机上,图像根本没有加载。将来自网址的网址中的图片加载到同一手机上的同一图像视图中,但从相册加载不起作用。

在此过程中我也会在logcat中获取这些内容:

I/MaliEGL: [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL: [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL: [Mali]max_allowed_dequeued_buffers=3

我也尝试使用Fresco库做同样的事情,而且也没有用。

这种行为可能是什么原因,我该如何解决?

0 个答案:

没有答案
相关问题