Code example for Stack

Methods: lastElement, remove

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