package com.vaguehope.onosendai.images;

import android.graphics.Bitmap;
import android.support.v4.util.LruCache;

public class BitmapCache<K> extends LruCache<K, Bitmap> {

	public BitmapCache (final int maxSizeBytes) {
		super(maxSizeBytes);
	}

	@Override
	protected int sizeOf (final K key, final Bitmap value) {
		return value.getByteCount();
	}

	@Override
	protected void entryRemoved (final boolean evicted, final K key, final Bitmap oldValue, final Bitmap newValue) {
		oldValue.recycle();
	}

}
@@ -472,16 +472,114 @@
 ue) %7B%0A%09%09
+// FIXME in retrospect, this is probably a bad idea as the image may still be in the UI, etc.%0A%09%09//
 oldValue

Disable Bitmap.recycle() as it may cause strange crashes.