Code example for WeakReference

Methods: get

0
		} 
		if(waitForActivity){
			waitForActivityIfNotAvailable(); 
		} 
		if(!activityStack.isEmpty()){
			activity=activityStack.peek().get();
		} 
		return activity;
	} 
 
	/** 
	 * Returns to the given {@link Activity}. 
	 * 
	 * @param name the name of the {@code Activity} to return to, e.g. {@code "MyActivity"} 
	 */ 
 
	public void goBackToActivity(String name)
	{ 
		ArrayList<Activity> activitiesOpened = getAllOpenedActivities();
		boolean found = false;	
		for(int i = 0; i < activitiesOpened.size(); i++){