From f23682f53822fd01214bad1878947e001b392b8c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 23 Dec 2018 15:45:30 +0100 Subject: Do not crash --- .../main/java/de/danoeh/antennapod/adapter/CoverTarget.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'app/src/main/java/de/danoeh/antennapod/adapter') 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 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))); } } -- cgit v1.2.3