Skip to content

Instantly share code, notes, and snippets.

@esmasui
Created July 3, 2013 05:42
Show Gist options
  • Select an option

  • Save esmasui/5915700 to your computer and use it in GitHub Desktop.

Select an option

Save esmasui/5915700 to your computer and use it in GitHub Desktop.
private ImageLoader.ImageCache newImageCache(final int size) {
return new ImageLoader.ImageCache() {
private LruCache<String, Bitmap> mCache = new LruCache<String, Bitmap>(size);
@Override
public Bitmap getBitmap(String url) {
return mCache.get(url);
}
@Override
public void putBitmap(String url, Bitmap bitmap) {
mCache.put(url, bitmap);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment