Code example for LruCache

Methods: getput

3
                 
    } 
     
    public void addBitmapToMemoryCache(String key, Bitmap bitmap) {
        if (getBitmapFromMemCache(key) == null) {
            mMemoryCache.put(key, bitmap);
        } 
    } 
 
    public Bitmap getBitmapFromMemCache(String key) {
        return mMemoryCache.get(key);
    } 
     
    public void loadBitmap(int resId, ImageView imageView) {
        final String imageKey = String.valueOf(resId);
 
        final Bitmap bitmap = getBitmapFromMemCache(imageKey);
        if (bitmap != null) {
            imageView.setImageBitmap(bitmap);
        } else {