Bitmap Cache

suggest change

Versions

LruCache, used below for bitmap caches, has been available since Android 4.0 (API 12).

Introduction

Cache bitmaps so you can reuse objects that are expensive to create. This matters for animation: a garbage-collection pause stops the animation and the app looks sluggish. Loading a bitmap into memory is itself a cache of that bitmap. Bitmap memory on Android is easy to get wrong, so cache a bitmap you will draw more than once.

Syntax

Parameters

Parameter Details
key Key used to store the bitmap in the memory cache.
bitmap Bitmap stored for that key.

Feedback about page:

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



Table Of Contents