From f23682f53822fd01214bad1878947e001b392b8c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 23 Dec 2018 15:45:30 +0100 Subject: [PATCH] Do not crash --- .../de/danoeh/antennapod/adapter/CoverTarget.java | 11 ++++++----- build.gradle | 2 +- 2 files changed, 7 insertions(+), 6 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 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))); } } diff --git a/build.gradle b/build.gradle index 144a291df..3e66c32eb 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ project.ext { eventbusVersion = "2.4.0" flattr4jVersion = "2.14" glideVersion = "4.8.0" - glideOkhttpIntegrationVersion = "1.5.0" + glideOkhttpIntegrationVersion = "4.8.0" iconifyVersion = "2.2.2" jsoupVersion = "1.11.2" materialDialogsVersion = "0.9.0.2"