Back to project page Svnit-Events.
The source code is released under:
MIT License
If you think the Android project Svnit-Events listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.bhatt.ramani.svnitevents; /*from w w w . j a va 2 s .c o m*/ import android.graphics.Bitmap; import android.support.v4.util.LruCache; public class EventLruCache { private LruCache<String, Bitmap> mMemoryCache; public EventLruCache(int cacheSize) { mMemoryCache = new LruCache<String, Bitmap>(cacheSize) { @Override protected int sizeOf(String key, Bitmap value) { return (value.getRowBytes() * value.getHeight()) / 1024; } }; } public void addBitmapToMemoryCache(String key, Bitmap bitmap) { if (getBitmapFromMemoryCache(key) == null) { mMemoryCache.put(key, bitmap); } } public Bitmap getBitmapFromMemoryCache(String key) { return mMemoryCache.get(key); } }