Android examples for App:Cache
add Bitmap to LruCache
//package com.book2s; import android.graphics.Bitmap; import android.util.LruCache; public class Main { private static LruCache<String, Bitmap> mCache; public static void addBitmap(Bitmap bitmap, String key) { if (getBitmap(key) == null) { mCache.put(key, bitmap);/*from www .j a va2 s . c o m*/ } } public static Bitmap getBitmap(String key) { return mCache.get(key); } }