Code example for ActionBar.Tab

Methods: getPosition

0
    public void onTabReselected(Tab tab, FragmentTransaction ft) {
    } 
 
    @Override 
    public void onTabSelected(Tab tab, FragmentTransaction ft) {
        int pos = tab.getPosition();
        mViewPager.setCurrentItem(pos);
    } 
 
    @Override 
    public void onTabUnselected(Tab tab, FragmentTransaction ft) {
    } 
}