Skip to content

Instantly share code, notes, and snippets.

@jraczak
Created October 7, 2016 14:54
Show Gist options
  • Save jraczak/45db74dc5163eee4dab5777cc73ef8f6 to your computer and use it in GitHub Desktop.
Save jraczak/45db74dc5163eee4dab5777cc73ef8f6 to your computer and use it in GitHub Desktop.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (mToggle.onOptionsItemSelected(item)) {
return true;
}
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment