Skip to content

Instantly share code, notes, and snippets.

@shunsugai
Created July 29, 2012 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shunsugai/3197108 to your computer and use it in GitHub Desktop.
Save shunsugai/3197108 to your computer and use it in GitHub Desktop.
AndroidのListViewで非同期で画像を表示する
package com.sugaishun.sample;
import java.util.HashMap;
import android.graphics.drawable.Drawable;
public class ImageCache {
private static HashMap<String, Drawable> cache = new HashMap<String, Drawable>();
public static Drawable get(String key) {
if (cache.containsKey(key))
return cache.get(key);
return null;
}
public static void set(String key, Drawable Image) {
cache.put(key, Image);
}
public static void clear() {
cache = null;
cache = new HashMap<String, Drawable>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment