为什么在
onNewResultImpl
中返回的位图为null?final ImageView imageView = (ImageView) findViewById (R.id.imageView);
ImageRequest request = ImageRequest.fromUri(pic_uri);
ImagePipeline imagePipeline = Fresco.getImagePipeline();
DataSource dataSource = imagePipeline.fetchEncodedImage(request, this);
CloseableReference<CloseableImage> imageReference = null;
dataSource.subscribe (new BaseBitmapDataSubscriber() {
@Override
protected void onNewResultImpl(Bitmap bitmap) {
LogUtils._d("onNewResultImpl....");
if(bitmap == null) {
LogUtils._d("bitmap is null");
}
imageView.setImageBitmap(bitmap);
}
@Override
protected void onFailureImpl(DataSource dataSource) {
LogUtils._d("onFailureImpl....");
}
}, CallerThreadExecutor.getInstance());