Placeholder and Error handling
suggest changeIf you want to add a Drawable be shown during the load, you can add a placeholder:
Glide.with(context) .load(yourUrl) .placeholder(R.drawable.placeholder) .into(imageView);
If you want a Drawable to be shown if the load fails for any reason:
Glide.with(context) .load(yourUrl) .error(R.drawable.error) .into(imageView);
If you want a Drawable to be shown if you provide a null model (URL, Uri, file path etc):
Glide.with(context) .load(maybeNullUrl) .fallback(R.drawable.fallback) .into(imageView);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents