Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.Bitmap; import android.support.v4.util.LruCache; public class Main { private static LruCache<String, Bitmap> lruCache; public static void openLrucache() { lruCache = new LruCache<String, Bitmap>((int) Runtime.getRuntime().maxMemory() / 8) { @Override protected int sizeOf(String key, Bitmap value) { return value.getRowBytes() * value.getHeight(); } }; } }