Android Bitmap Save addBitmapToMemoryCache(String key, Bitmap bitmap)

Here you can find the source of addBitmapToMemoryCache(String key, Bitmap bitmap)

Description

add Bitmap To Memory Cache

Declaration

private static void addBitmapToMemoryCache(String key, Bitmap bitmap) 

Method Source Code

//package com.java2s;

import android.graphics.Bitmap;

import android.support.v4.util.LruCache;

public class Main {
    private static LruCache<String, Bitmap> mMemoryCache;

    private static void addBitmapToMemoryCache(String key, Bitmap bitmap) {
        if (getBitmapFromMemCache(key) == null) {
            mMemoryCache.put(key, bitmap);
        }/*from ww  w.j  a  v a  2 s . com*/
    }

    private static Bitmap getBitmapFromMemCache(String key) {
        return mMemoryCache.get(key);
    }
}

Related

  1. base64Bitmap(Bitmap bitmap)
  2. bitmap2File(Bitmap bitmap, File file)
  3. bitmap2Stream(Bitmap bitmap)
  4. getImagePath(Context context, Bitmap inImage)