Example #1
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   if (!mNavigationDrawerFragment.isDrawerOpen()) {
     // Only show items in the action bar relevant to this screen
     // if the drawer is not showing. Otherwise, let the drawer
     // decide what to show in the action bar.
     getMenuInflater().inflate(R.menu.main, menu);
     return true;
   }
   return super.onCreateOptionsMenu(menu);
 }
Example #2
0
 @Override
 public void onBackPressed() {
   if (mNavigationDrawerFragment.isDrawerOpen()) mNavigationDrawerFragment.closeDrawer();
   else super.onBackPressed();
 }