Code example for WeakReference

Methods: clear

0
		public void attach(CreateFinderActivity a) {
			ref = new WeakReference<CreateFinderActivity>(a);
		} 
 
		public void detach() { 
			ref.clear();
		} 
 
	} 
 
	private static class SubmitFinder  
		extends AsyncTask<String, Integer, String> 
			implements IAsyncTask<CreateFinderActivity> { 
		 
		private List<NameValuePair> finderData = new ArrayList<NameValuePair>();
		private WeakReference<CreateFinderActivity> ref;
		private ProgressDialog progressDialog = null;
 
		public SubmitFinder(CreateFinderActivity a) {
			attach(a);
		}