Code example for WeakReference

Methods: get

0
	public int getIndex() { 
		return index;
	} 
 
	public View getView() {
		return viewRef != null ? viewRef.get() : null;
	} 
	 
	synchronized void resetWithIndex(int index) {
		this.index = index;
		viewRef = null;
		recycleScreenshot(); 
		recycleTexture(); 
	} 
 
	synchronized boolean loadView(int index, View view, Bitmap.Config format) {
		UI.assertInMainThread(); 
 
		if (this.index == index 
				&& getView() == view
				&& (screenshot != null || TextureUtils.isValidTexture(texture))