Code example for Stack

Methods: lastElement, remove

0
 
	/** 
	 * finish the last activity 
	 */ 
	public void finishActivity() { 
		Activity activity = activityStack.lastElement();
		finishActivity(activity);
	} 
 
	/** 
	 * finish the Activity 
	 */ 
	public void finishActivity(Activity activity) {
		if (activity != null) {
			activityStack.remove(activity);
			activity.finish();
			activity = null;
		} 
	} 
 
	/**