diff --git a/app/src/main/java/com/hippo/widget/LoadImageView.java b/app/src/main/java/com/hippo/widget/LoadImageView.java index 612be205a..b479d72b5 100644 --- a/app/src/main/java/com/hippo/widget/LoadImageView.java +++ b/app/src/main/java/com/hippo/widget/LoadImageView.java @@ -278,7 +278,12 @@ public void onWait() { public boolean onGetValue(@NonNull Image value, int source) { Drawable drawable; try { - drawable = value.getDrawable(); + Drawable.ConstantState state = value.getDrawable().getConstantState(); + if (state!=null){ + drawable = state.newDrawable(); + }else { + drawable = value.getDrawable(); + } } catch (Exception e) { // The image might be recycled because it is removed from memory cache. Log.d(TAG, "The image is recycled", e); diff --git a/app/src/main/java/com/hippo/widget/LoadImageViewNew.java b/app/src/main/java/com/hippo/widget/LoadImageViewNew.java index e9a099cd5..0a51e47ef 100644 --- a/app/src/main/java/com/hippo/widget/LoadImageViewNew.java +++ b/app/src/main/java/com/hippo/widget/LoadImageViewNew.java @@ -280,6 +280,7 @@ public boolean onGetValue(@NonNull Image value, int source) { Drawable drawable; try { drawable = value.getDrawable(); + } catch (Exception e) { // The image might be recycled because it is removed from memory cache. Log.d(TAG, "The image is recycled", e);