diff options
author | ByteHamster <info@bytehamster.com> | 2018-12-23 15:45:30 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2018-12-23 15:45:30 +0100 |
commit | f23682f53822fd01214bad1878947e001b392b8c (patch) | |
tree | e599ac39f6170cd5f3fabc15034cac41bf801cb1 /app/src/main/java/de/danoeh/antennapod/adapter | |
parent | 580cc49b1b1f20668a3bc28a9a920e3b437dfe21 (diff) | |
download | AntennaPod-f23682f53822fd01214bad1878947e001b392b8c.zip |
Do not crash
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/adapter')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/CoverTarget.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/CoverTarget.java b/app/src/main/java/de/danoeh/antennapod/adapter/CoverTarget.java index 5c6980b85..656a8d15b 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/CoverTarget.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/CoverTarget.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.adapter; import android.graphics.drawable.Drawable; +import android.os.Handler; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.View; @@ -39,13 +40,13 @@ class CoverTarget extends CustomViewTarget<ImageView, Drawable> { ImageView imgvCover = cover.get(); if (fallbackUri != null && txtvPlaceholder != null && imgvCover != null) { MainActivity activity = mainActivity.get(); - Glide.with(activity) + new Handler().post(() -> Glide.with(activity) .load(fallbackUri) .apply(new RequestOptions() - .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) - .fitCenter() - .dontAnimate()) - .into(new CoverTarget(null, txtvPlaceholder, imgvCover, activity)); + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) + .fitCenter() + .dontAnimate()) + .into(new CoverTarget(null, txtvPlaceholder, imgvCover, activity))); } } |