Code example for ActionBar

Methods: getNavigationModesetNavigationModesetSelectedNavigationItemsetTitle

0
            } 
            if (mListener != null) {
                mListener.onAction(Action.START_SEARCH_MODE);
            } 
        } else { 
            final int currentNavigationMode = mActionBar.getNavigationMode();
            if (mActionBarNavigationMode == ActionBar.NAVIGATION_MODE_TABS
                    && currentNavigationMode != ActionBar.NAVIGATION_MODE_TABS) {
                // setNavigationMode will trigger onTabSelected() with the tab which was previously 
                // selected. 
                // The issue is that when we're first switching to the tab navigation mode after 
                // screen orientation changes, onTabSelected() will get called with the first tab 
                // (i.e. favorite), which would results in mCurrentTab getting set to FAVORITES and 
                // we'd lose restored tab. 
                // So let's just disable the callback here temporarily.  We'll notify the listener 
                // after this anyway. 
                mTabListener.mIgnoreTabSelected = true;
                mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
                mActionBar.setSelectedNavigationItem(mCurrentTab);
                mTabListener.mIgnoreTabSelected = false;
            } else if (mActionBarNavigationMode == ActionBar.NAVIGATION_MODE_LIST
                    && currentNavigationMode != ActionBar.NAVIGATION_MODE_LIST) {
                mNavigationListener.mIgnoreNavigationItemSelected = true;
                mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
                mActionBar.setSelectedNavigationItem(
                        getNavigationItemPositionFromTabPosition(mCurrentTab));
                mNavigationListener.mIgnoreNavigationItemSelected = false;
            } 
            mActionBar.setTitle(null);
            // Since we have the {@link SearchView} in a custom action bar, we must manually handle 
            // collapsing the {@link SearchView} when search mode is exited. 
            if (isIconifiedChanging) {
                mSearchView.onActionViewCollapsed();
            } 
Stop searching for code, let great code find you!  Add Codota to your java IDE