Last active
December 17, 2015 21:29
-
-
Save moltak/5675386 to your computer and use it in GitHub Desktop.
ActionbarDrawerToggle button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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