我在使用Picasso(' com.squareup.picasso:picasso:2.5.2' )在Moto G(第二代5.0)中加载图像时遇到问题。 2)。 这是代码:
Transformation transformation = new RoundedTransformationBuilder()
.cornerRadiusDp(cornerRadiusDp)
.oval(false)
.build();
Picasso.with(MAPetApplication.getContext())
.load(uri)
.centerCrop()
.resize(targetWidth, targeHeight)
.transform(transformation)
.into(imageView, new Callback() {
@Override
public void onSuccess() {
}
@Override
public void onError() {
}
});
调试时我注意到void complete(BitmapHunter hunter)
内的Picasso.class
方法返回null
结果:
void complete(BitmapHunter hunter) {
...
if(shouldDeliver) {
Uri uri = hunter.getData().uri;
Exception exception = hunter.getException();
Bitmap result = hunter.getResult();
Picasso.LoadedFrom from = hunter.getLoadedFrom();
if(single != null) {
this.deliverAction(result, from, single);
}
...
}
exception = java.io.IOException:无法重置
投放:
result = null
from =" DISK"
single = com.square.picasso.ImageViewAction
private void deliverAction(Bitmap result, Picasso.LoadedFrom from, Action action) {}
而不是交付:
result = android.graphic.Bitmap
from =" DISK"
single = com.square.picasso.ImageViewAction
产生action.error();
它可能是什么?
感谢。
ps:在Moto RAZRi 4.1.2,Nexus S 4.4.1,GT-I9505 4.4.2,Nexus 5 5.0.0 / 5.1.0,One Plus One 5.0.2中测试,它运行良好。