Open ghost opened 10 years ago
I second the need for "&& !value.isBeingDisplayed()". If you have CacheableImageViews that are always visible, and CacheableImageViews in a list view as well, the bitmap of the statically visible image will often get recycled incorrectly (and start showing one of the images from the list).
In BitmapMemoryLruCache#getBitmapFromRemoved method, we judge if the bitmap is used by following: value != null && value.isBitmapValid() && value.isBitmapMutable() This is not enough and should be added following: && !value.isBeingDisplayed() && !value.isReferencedByCache()
This is because LruCache#entryRemoved is not called on the bitmap is no more used but called on the last method call of LruCache#get for the bitmap is in the distant past.
I met this issue when using ListView on ViewPager. When I scrolled ListView enough and changed page, bitmaps on another pages are not correct.