Code example for WeakReference

Methods: clear, get

0
 
		} 
 
		@Override 
		protected void onPostExecute(final Place p) {
			ref.get().updateAsyncTaskProgress(p);
			detach(); 
		} 
 
		public void attach(PlaceInfoActivity a) {
			ref = new WeakReference<PlaceInfoActivity>(a);
		} 
 
		public void detach() { 
			ref.clear();
		} 
	} 
 
	@Override 
	protected boolean isRouteDisplayed() { 
		// TODO Auto-generated method stub