I have a RecylerView in which each item contains Iamge, to load image I'm using Glide. The problem I'm facing is that some images in the list not showing up and in my onException call back both Exception and model are null for these images.
if you will see the fourth item in the list images is not showing.
Here is how i am coding this
Glide.with(context).load(productItem.getImg())
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.listener(new RequestListener<String, GlideDrawable>() {
@Override
public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
if( e != null) {
e.printStackTrace();
}
return false;
}
@Override
public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
return false;
}
}).
into(holder.imageViewModel);
enter code here
and in xml i have ImageView declare like this
<ImageView
android:id="@+id/imageViewModel"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="@dimen/cart_vertical_margin"/>