Code example for LruCache

0
    public ImageLruCache() { 
        this(PRIVATE_IMAGE_MEM_CACHE_MAX_SIZE);
    } 
 
    public ImageLruCache(int capacity) {
        mImageMemCache = new LruCache<Integer, Drawable>(capacity);
    } 
 
    public Drawable get(int key) {
        Drawable thumb = mImageMemCache.get(key);
        if (thumb != null) {
            if (ENABLE_VERBOSE)
                DebugLog.vfmt("ImageLruCache", "get %d", key);
            return thumb;
        } 
 
        thumb = sGlobalMemCache.get(key);
        if (thumb != null) {
            if (ENABLE_VERBOSE)
                DebugLog.vfmt("ImageLruCache", "get %d global", key);
Stop searching for code, let great code find you!  Add Codota to your java IDE