Code example for ActionBar

Methods: addTabnewTab

0
    } 
    public void attachTabs(ActionBar bar)
    { 
		TabListener tl = new TabListener(this,this);
    	 
    	Tab tab1 = bar.newTab();
    	tab1.setText("Tab1");
    	tab1.setTabListener(tl);
    	bar.addTab(tab1);
    	 
    	Tab tab2 = bar.newTab();
    	tab2.setText("Tab2");
    	tab2.setTabListener(tl);
    	bar.addTab(tab2);
    } 
}//eof-class 
Contextual code suggestions in your IDE  Get Codota for Java