I use the Navigation Drawer from the standard Google example:
if (mDrawerLayout.isShown()) { mDrawerLayout.closeDrawers(); } else { //mDrawerLayout.openDrawer(Gravity.RIGHT); //mDrawerLayout.openDrawer(Gravity.LEFT); //mDrawerLayout.openDrawer(mDrawerLayout); //mDrawerLayout.openDrawer(mDrawerLayout.getForegroundGravity()); } In this code, the part that closes the Navigation Drawer works without problems, but none of the methods that I call to open, does not work: either they are simply ignored, or I use them incorrectly (uncommented in turn).
So I initialize the objects to work with Navigation Drawer :
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerToggle = new ActionBarDrawerToggle( this, /* host Activity */ mDrawerLayout, /* DrawerLayout object */ R.drawable.ic_ab_app, /* nav downloaded_list icon to replace 'Up' caret */ R.string.vk_retry, /* "open downloaded_list" description */ R.string.vk_new_post_settings /* "close downloaded_list" description */ ) { /** * Called when a downloaded_list has settled in a completely closed state. */ public void onDrawerClosed(View view) { super.onDrawerClosed(view); //getActionBar().setTitle("closed"); } /** * Called when a downloaded_list has settled in a completely open state. */ public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); //getActionBar().setTitle("opened"); } };