Code example for ActionBar.Tab

Methods: setTabListener, setText

0
		bar = this.getActionBar();
		bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
		 
		//Add 2 tabs 
		tab = bar.newTab();
		tab.setText("Incoming");
		tab.setTabListener(new TabListener<MessagesIncomingFragment>(this,"tag",MessagesIncomingFragment.class));
		bar.addTab(tab);
		 
		tab = bar.newTab();
		tab.setText("Sent");
		tab.setTabListener(new TabListener<MessagesIncomingFragment>(this,"tag",MessagesIncomingFragment.class));
		bar.addTab(tab);
		 
	} 
 
	@Override 
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		setActivityTitle(R.string.title_activity_conversation_list); 
		return true;