Code example for SoftReference

Methods: clear

0
 
    public static void destroy(Integer id) {
        SoftReference<Drawable> reference = cache.remove(id);
 
        if (reference != null) {
            reference.clear();
        } 
 
        reference = null;
    } 
 
    public static void destroyAll() { 
        if (null == cache || null == keyCache) {
            return; 
        } 
 
        synchronized (cache) {
            while (keyCache.size() > 0) {
                destroy(keyCache.remove(keyCache.size() - 1));
            } 
        }