Skip to content

Instantly share code, notes, and snippets.

@Cheesebaron
Created May 31, 2013 11:15
Show Gist options
  • Save Cheesebaron/5684336 to your computer and use it in GitHub Desktop.
Save Cheesebaron/5684336 to your computer and use it in GitHub Desktop.
Quick and dirty menu item.
public override bool OnCreateOptionsMenu(IMenu menu)
{
var item = menu.Add(0,1,1,"Back");
//If you want an icon set it here
item.SetIcon(Resource.drawable.ic_menu_back);
return true;
}
public override bool OnOptionsItemSelected(IMenuItem item)
{
switch (item.ItemId)
{
case 1: Back();
return true;
default:
return base.OnOptionsItemSelected(item);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment