In my Android app I am calling a URL for fetching images and that URL is also fetched dynamically. Sometimes what happened is that the server returns the path of the image but actually there is no image so can we put some kind of validation.
Share
When the url has finished loading try to decode the result into a
Bitmapobject withdecodeByteArrayordecodeStream, if it returns null the image is invalid.