Skip to content

Instantly share code, notes, and snippets.

@moltak
Last active December 17, 2015 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moltak/5675386 to your computer and use it in GitHub Desktop.
Save moltak/5675386 to your computer and use it in GitHub Desktop.
ActionbarDrawerToggle button
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Pass the event to ActionBarDrawerToggle, if it returns
// true, then it has handled the app icon touch event
if ((item != null) && (item.getItemId() == 16908332) && (mDrawerToggle.isDrawerIndicatorEnabled())) {
if (this.mDrawerLayout.isDrawerVisible(Gravity.LEFT))
this.mDrawerLayout.closeDrawer(Gravity.LEFT);
else {
this.mDrawerLayout.openDrawer(Gravity.LEFT);
}
}
return super.onOptionsItemSelected(item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment