Code example for ActionBar.Tab

Methods: getTag

0
	/* The following are each of the ActionBar.TabListener callbacks */ 
 
	@Override 
	public void onTabSelected(Tab tab, FragmentTransaction ft) {
		// Check if the fragment is already initialized 
		String tag = (String)tab.getTag();
		if (tag.equals(SEND_MESSAGE_FRAGMENT_TAG)){
			ft.attach(sendMessageFragment);
		} 
		else if (tag.equals(READ_MESSAGE_FRAGMENT_TAG)){
			ft.attach(readMessageFragment);
		} 
	} 
 
	@Override 
	public void onTabUnselected(Tab tab, FragmentTransaction ft) {
 
		String tag = (String)tab.getTag();
 
		if (tag.equals(SEND_MESSAGE_FRAGMENT_TAG)){
			ft.detach(sendMessageFragment);