diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/RssItemViewHolder.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/RssItemViewHolder.java index 0d4986e4c..ef15e105f 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/RssItemViewHolder.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/adapter/RssItemViewHolder.java @@ -220,6 +220,7 @@ public void bind(@NonNull RssItem rssItem) { ImageView imgViewFavIcon = getImageViewFavIcon(); + favIconHandler.setContext(itemView.getContext()); if (imgViewFavIcon != null) { favIconHandler.loadFavIconForFeed(favIconUrl, imgViewFavIcon, Math.round((marginFavIcon - sizeOfFavIcon) / 2f)); } diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FavIconHandler.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FavIconHandler.java index 31291cf25..513a60364 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FavIconHandler.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/helper/FavIconHandler.java @@ -48,8 +48,8 @@ public class FavIconHandler { private static final String TAG = FavIconHandler.class.getCanonicalName(); - private final RequestManager mGlide; - private final Context mContext; + private RequestManager mGlide; + private Context mContext; private final int mPlaceHolder; public FavIconHandler(Context context) { @@ -155,4 +155,12 @@ private void UpdateAvgColorOfFeed(long feedId, Bitmap bitmap, Context context) { Log.v(TAG, "Failed to update AVG color of feed: " + feedId); } } + + public void setContext(Context context) { + if (context == mContext) { + return; + } + mContext = context; + mGlide = Glide.with(context); + } }