Code example for ActionBarDrawerToggle

Methods: getActionBar, invalidateOptionsMenu

1
                R.drawable.ic_navigation_drawer,  /* nav drawer image to replace 'Up' caret */ 
                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(mTitle);
                invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
            } 
 
            public void onDrawerOpened(View drawerView) {
                getActionBar().setTitle(mDrawerTitle);
                invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
            } 
        }; 
        mDrawerLayout.setDrawerListener(mDrawerToggle);
         
        GestureOverlayView gestureOverlayView = (GestureOverlayView)findViewById(R.id.gestureOverlayView1);
        gestureOverlayView.addOnGesturePerformedListener(this);
    }