Created
July 29, 2012 09:45
-
-
Save shunsugai/3197108 to your computer and use it in GitHub Desktop.
AndroidのListViewで非同期で画像を表示する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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