I am loading an image with Glide, as follows.
Glide.with(myActivity.this).load(url1).diskCacheStrategy(DiskCacheStrategy.ALL).into(avatarImageView);
It turns out that sometimes it fails me, since sometimes the url1 doesn't exist, and I have to load a url2 . (url1 and url2 is a String that corresponds to the URL of the image)
I want to know how to retry with url2 if url1 fails...
Thank you!
EDIT: url1 and url2 are not null or empty. They have different formats when they were created and I should try one format first and if it doesn't load then try the other format.
Example:
String url1= "http://www.foto.xd/juan_perez_123456.jpg";
String url2= "http://www.foto.xd/123456.jpg";