Code example for Stack

Methods: empty, firstElement

0
    public Activity getRootActivity(int index)
    { 
 
    	if(index >=0 && index < tabs.size()){
    		TabSpec tabspec =tabs.get(index);
    		if(!(tabspec.navStack.empty())){
    			ActivityRecord activityRecord = tabspec.navStack.firstElement();
    			return activityRecord.activity;
    		} 
    	} 
    	return null;         
    } 
 
    protected void onDestroy() 
    { 
        for(TabSpec tabspec = tabs.get(currentTab); !tabspec.navStack.empty();){
            tabspec.navStack.pop();
        	} 
            tabs.clear();
        tabs = null;
        content = null;