0
我使用SubsamplingScaleImageView與滑翔加載,緩存和顯示圖片:滑翔:無法複製回收的位圖
SubsamplingScaleImageView mImageView;
Glide.with(this)
.load(url)
.asBitmap()
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
mImageView.setImage(ImageSource.bitmap(
Bitmap.createBitmap(resource, x1, y1, x2 - x1, y2 - y1)));
}
});
它的工作原理,但有時死機,錯誤IllegalStateException: Can't copy a recycled bitmap
在Bitmap.createBitmap
。如何解決它?
但是,此檢查圖像將不會顯示。有另一種方式來實現呢? – BArtWell
你必須找出原因是什麼/什麼條件下,/什麼樣的結果你'Bitmap'得到回收。在這個階段(在這個回調),我想不出比試圖重新加載圖像的任何其他。 – azizbekian