0

I have a little problem using Glide. In my app I use Glide to show pictures from Firestore documents in an ImageView. This picture can be changed by the user if they tap on the ImageView.

This works perfectly except for one condition: I have a field in my Firestore documents for the url but sometimes this field is an empty string (""). When it's empty, the SetImageAsBitmap() method (which I'm using to set and change pictures) doesn't work, it only shows the error image set in Glide. When this field contains a valid link for the picture or I delete the whole Glide code snippet (see below) it changes perfectly.

Glide.with(getActivity())
.load(documentSnapshot.getString("jobPictureUrl"))
.fitCenter()
.error(ContextCompat.getDrawable(getActivity(), R.drawable.photo))
.into(jobImage);

My guess is it's something about my Glide method, because the SetImageAsBitmap() works as needed. Thanks for your help!

d_vain
  • 25
  • 4

0 Answers0