Code example for ActionBar.Tab

Methods: getTag

0
        state.putInt(KEY_POSITION, pager.getCurrentItem());
    } 
 
    @Override 
    public void onTabSelected(Tab tab, FragmentTransaction ft) {
        Integer position = (Integer) tab.getTag();
        pager.setCurrentItem(position);
    } 
 
    @Override 
    public void onTabReselected(Tab tab, FragmentTransaction ft) {
        // noop 
    } 
 
    @Override 
    public void onTabUnselected(Tab tab, FragmentTransaction ft) {
        // noop 
    } 
 
    @Override 
    public void onPageScrollStateChanged(int state) {