Back to project page photos.
The source code is released under:
MIT License
If you think the Android project photos 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.ericfarraro.photos.singletons; /*from w w w . java 2 s. c o m*/ import android.graphics.Bitmap; import android.util.LruCache; /** * Created by Eric on 10/8/2014. */ public class PhotoCache extends LruCache<String, Bitmap> { private static final PhotoCache mInstance = new PhotoCache(); protected PhotoCache() { // create a cache that uses 1/8th of the available space super((int)Runtime.getRuntime().maxMemory() / 1024 / 8); } @Override protected int sizeOf(String key, Bitmap value) { return value.getByteCount() / 1024; } public static PhotoCache getInstance() { return mInstance; } }