Code example for ActionBar

Methods: setNavigationMode

0
 
    @Override 
    protected void setUp() { 
        if (mActionBar == null) {
            mActionBar = mActivity.getActionBar();
            mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        } 
    } 
 
    @Override 
    public void addTab(CompatTab tab) {
        String tag = tab.getTag();
 
        // Check to see if we already have a fragment for this tab, probably 
        // from a previously saved state.  If so, deactivate it, because our 
        // initial state is that a tab isn't shown. 
 
        Fragment fragment = mActivity.getSupportFragmentManager().findFragmentByTag(tag);
        tab.setFragment(fragment);
 
        if (fragment != null && !fragment.isDetached()) {