Code example for ActionBar.Tab

Methods: getPosition

0
        @Override public void onTabReselected(Tab tab, FragmentTransaction ft) { }
        @Override public void onTabUnselected(Tab tab, FragmentTransaction ft) { }
 
        @Override public void onTabSelected(Tab tab, FragmentTransaction ft) {
            if (!mIgnoreTabSelected) {
                setCurrentTab(tab.getPosition());
            } 
        } 
    } 
 
    private class MyNavigationListener implements ActionBar.OnNavigationListener {
        public boolean mIgnoreNavigationItemSelected;
 
        public boolean onNavigationItemSelected(int itemPosition, long itemId) {
            if (!mIgnoreNavigationItemSelected) {
                setCurrentTab(getTabPositionFromNavigationItemPosition(itemPosition));
            } 
            return true; 
        } 
    }