Glide: Cannot setImageBitmap on a ImageView if the imageView is already set by Glide

Created on 29 Apr 2015  路  5Comments  路  Source: bumptech/glide

Hey,

I am having this issue with Glide.

So if I use Glide to load a image into an imageView, i.e. Glide.with(..).load(..).into(imageView), I cannot do imageView.setImageBitmap(..) anymore. There is no exception thrown, but the imageView still displays the old image from Glide.

The workaround is to use Glide all the way, i.e., always use Glide...into(imageView). The imageView is correctly set everytime.

I am wondering if this is a known issue? I think Glide should not take away to Android's native setImageBitmap()?

Thanks!
Wei

question

Most helpful comment

Glide doesn't necessarily take that method away, but Glide assumes that it's managing a view until you tell it not to. That means that if you start a load on a view, and then set a Bitmap on that view, Glide's load may then finish and replace the image with the one from Glide.

To stop Glide from managing the view, always call Glide.clear(View) before setting any resources.

All 5 comments

Glide doesn't necessarily take that method away, but Glide assumes that it's managing a view until you tell it not to. That means that if you start a load on a view, and then set a Bitmap on that view, Glide's load may then finish and replace the image with the one from Glide.

To stop Glide from managing the view, always call Glide.clear(View) before setting any resources.

you are awesome. Thank you Sam.

Great, glad that answered your question!

Great!

and here i am pulling my hair off because of this problem

Was this page helpful?
0 / 5 - 0 ratings