Code example for ActionBar.Tab

Methods: getPosition

0
    } 
 
    @Override 
    public void onTabUnselected(Tab tab, FragmentTransaction ft) {
 
        int position = tab.getPosition();
        switch (position) {
             
            case 0: 
                if (mDualPane)
                    ft.remove(mColorFragment);
                break; 
                 
            case 1: 
                ft.show(mListFragment);
                ft.remove(mTextFragment);
                break; 
        } 
         
    } 
Connect your IDE to all the code out there  Get Codota for Java