glide icon indicating copy to clipboard operation
glide copied to clipboard

Canvas: trying to use a recycled bitmap android.graphics.Bitmap@1e8150d

Open 1mean opened this issue 4 months ago • 1 comments

Glide Version: V4.12.0 Question: UI:TabLayout + RecyclerView Function:only one RecyclerView . to display different data. When the user switches between different TabItems in the TabLayout, different data needs to be requested from the server, and then the previous data should be cleared from this RecyclerView to display the latest data, When rapidly switching between tabs in TabLayout, this error occurs when loading images in RecyclerView, causing the app to crash.

Can I solve this problem by upgrading the glide version? Or there might be other ways to solve this problem

1mean avatar Aug 18 '25 09:08 1mean

@1mean after a lot of digging i found the issue here. Your cache memory size is not big enough. You need to increase it using something like:

MemorySizeCalculator calculator = new MemorySizeCalculator.Builder(context)
        .setMemoryCacheScreens(4)
        .build();
LruResourceCache memoryCache = new LruResourceCache(calculator.getMemoryCacheSize());

farfromrefug avatar Dec 05 '25 21:12 farfromrefug