Code example for SoftReference

Methods: clear, get

0
						if (bitmap != null) { // bitmap not GC'd yet
							final Object tag = innerViewRef.getTag();
							if (tag != null && tag.equals(key.hash())) {
								setImageBitmap(innerViewRef, bitmap, source);
								if (mListener != null) { // notify caller
									final OnBitmapImageSetListener listener = mListener.get();
									if (listener != null) {
										listener.onBitmapImageSet(key, bitmap, source);
										mListener.clear();
									} 
								} 
							} else if (BITMAP_DEBUG) { // debugging
								Log.v(TAG, "Runnable: view tag not matching: " + key.getUrl());
							} 
						} else if (BITMAP_DEBUG) { // debugging
							Log.v(TAG, "Runnable: null bitmap reference: " + key.getUrl());
						} 
					} else if (BITMAP_DEBUG) { // debugging
						Log.d(TAG, "Runnable: null image view: " + key.getUrl());
					} 
					// remove runnable from the handler queue