LruCache

suggest change

Versions

This topic was documented against Android 3.1 through 7.1.

Remarks

You should use LruCache in applications where repetitive resource loads would affect smooth app behaviour. For example, a photo gallery with big thumbnails (128x128).

Always be careful with the size of the LruCache, since setting it too high might affect the app.

After the LruCache is no longer useful, avoid holding any references to it so the garbage collector can clean it up.

For the best performance, remember to load resources such as bitmaps using the best practices, such as selecting a proper inSampleSize before adding the bitmap to the LruCache.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents