Code example for ActionBarDrawerToggle

Methods: getActionBar, invalidateOptionsMenu

0
                R.string.drawer_close) { 
 
            /** Called when a drawer has settled in a completely closed state. */ 
            public void onDrawerClosed(View view)
            { 
                getActionBar().setTitle("Lol");
                invalidateOptionsMenu(); // creates call to
                                         // onPrepareOptionsMenu() 
            } 
 
            /** Called when a drawer has settled in a completely open state. */ 
            public void onDrawerOpened(View drawerView)
            { 
                getActionBar().setTitle("Awerem");
                invalidateOptionsMenu(); // creates call to
                                         // onPrepareOptionsMenu() 
            } 
        }; 
 
        // Set the drawer toggle as the DrawerListener 
        mDrawerLayout.setDrawerListener(mDrawerToggle);