I am using Firebase Storage to store user profile photo, I made a method to fetch the image and put it in an ImageView. It works great when the image exists in Firebase, but when it does not exist, it leaves ImageView with nothing, neither the standard image that I put in XML appears. How do I handle when the method does not return an image?
private void buscarFotoPerfil(String idUsuario) {
try {
storage = ConexaoFirebase.getStorageReference()
.child("images/perfil/" + idUsuario + ".jpg");
Glide.with(this)
.using(new FirebaseImageLoader())
.load(storage)
.into(imagePerfil);
} catch (Exception e) {
Toast.makeText(this, "Erro ao carregar foto do perfil." + e, Toast.LENGTH_SHORT).show();
}
}