Code example for ActionBarDrawerToggle

Methods: getActionBar, invalidateOptionsMenu

0
                R.string.drawer_open,  /* "open drawer" description for accessibility */ 
                R.string.drawer_close  /* "close drawer" description for accessibility */ 
        ) { 
            public void onDrawerClosed(View view) {
                getActionBar().setTitle(title);
                invalidateOptionsMenu();
            } 
 
            public void onDrawerOpened(View drawerView) {
                getActionBar().setTitle(drawerTitle);
                invalidateOptionsMenu();
            } 
        }; 
        drawerLayout.setDrawerListener(drawerToggle);
 
        if (state == null) {
            selectItem(0); 
        } 
    } 
 
    @Override