Android Glide: prevent white image if the request fails
For newer versions of Glide, the syntax for setting an error image is as follows:
Glide.with(mContext)
.load(url)
.error(Glide.with(imgView).load(R.drawable.ic_image_when_url_fails))
.into(imgView);
you can use .error(mDefaultBackground) --> Sets a Drawable to display if a load fails.
to keep image. just like below
Drawable mDefaultBackground = getResources().getDrawable(R.drawable.default_background);
Glide.with(getActivity())
.load(uri)
.centerCrop()
.error(mDefaultBackground).into(target);
from documentation