Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning using Glide in Recyclerview

I have just started moving from Universal Image Loader to Glide. However, when scrolling down and up again in recyclerview I get tons of warning messages.

W/Bitmap: Called reconfigure on a bitmap that is in use! This may cause graphical corruption!

If i swap out Glide for another image loading library, the warning goes away. Code in bindViewHolder related to images:

   Glide.with(viewHolder.imageView.getContext())
            .load(DisplayImageUtil.getImageUrl(item.getImageUrl(), 600))
            .diskCacheStrategy(DiskCacheStrategy.ALL)
            .into(viewHolder.imageView);

Tested on a Nexus 5.

like image 592
Bendik Avatar asked Oct 27 '15 08:10

Bendik


1 Answers

I run to the same issue after first run of my app on Android M (Nexus 5x).

EDIT: after opening the issue on Glide Github - https://github.com/bumptech/glide/issues/743, I found that my orignal "solution" did not solve the problem, only hide the messages. The warning comes from Android Bitmap and it is because Glide reuses the Bitmap for better performance.

like image 71
JirkaV Avatar answered Oct 05 '22 19:10

JirkaV