Skip to content

Instantly share code, notes, and snippets.

@wirasetiawan29
Created January 5, 2016 13:06
Show Gist options
  • Save wirasetiawan29/7082ae7d68e871bd0c14 to your computer and use it in GitHub Desktop.
Save wirasetiawan29/7082ae7d68e871bd0c14 to your computer and use it in GitHub Desktop.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu,menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_add_task:
Log.d("MainActivity","Add a new task");
return true;
default:
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment