我正在尝试使用毕加索加载大图像
public static final int MAX_WIDTH= 500;
public static final int MAX_HEIGHT= 500;
Picasso.with(imageView.getContext())
.load(Utils.imagePath(list.get(position).getImage()))
.resize(MAX_WIDTH,MAX_HEIGHT)
.onlyScaleDown()
.memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE)
.into(imageView);但是我得到了致命的异常: java.lang.OutOfMemoryError对于上面的代码,我试图加载的图像与下面的图像一模一样

我应该从后端调整图像的大小吗?或者我可以做些什么来避免这种情况?任何帮助都将不胜感激。
发布于 2017-08-19 16:22:56
尝试使用大堆。在manifest文件中插入android:largeheap="true"
<application
android:name=".MyApplication"
.....
.....
android:largeHeap="true"
.....
.....
android:theme="@style/AppTheme" >
</application>另外,最好还是使用.fit()。
.fit() -这将导致请求的延迟执行,直到ImageView布局完成。
https://stackoverflow.com/questions/45765032
复制相似问题