Code example for ActionBarActivity

Methods: onSaveInstanceState

0
        mDrawerToggle.onConfigurationChanged(newConfig);
    } 
 
    @Override 
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        if (mDrawerLayout.isDrawerOpen(mDrawerList)) {
            outState.putString(TITLE_KEY, mDrawerTitle.toString());
        } else { 
            outState.putString(TITLE_KEY, mTitle.toString());
        } 
    } 
 
    public void selectItem(int position) {
        supportInvalidateOptionsMenu(); 
        mViewPager.setCurrentItem(position);
        mDrawerList.setItemChecked(position, true);
        setTitle(mMenuTitles[position]);
        mDrawerLayout.closeDrawer(mDrawerList);
    }