Skip to content

Instantly share code, notes, and snippets.

@espritm
Last active Mar 22, 2017
Embed
What would you like to do?
public override bool OnCreateOptionsMenu(Android.Views.IMenu menu)
{
MenuInflater.Inflate(Resource.Menu.top_menus, menu);
return base.OnCreateOptionsMenu(menu);
}
public override bool OnOptionsItemSelected(IMenuItem item)
{
switch (item.ItemId)
{
case Resource.Id.share:
Intent sendShareIntent = new Intent(Intent.ActionSend)
.SetType("text/plain")
.PutExtra(Intent.ExtraText, "www.maximeesprit.com");
StartActivity(sendShareIntent);
break;
case Resource.Id.moreoption:
if (SupportActionBar.Title == Resources.GetString(Resource.String.titleRenamed))
SupportActionBar.Title = Resources.GetString(Resource.String.titleBase);
else
SupportActionBar.Title = Resources.GetString(Resource.String.titleRenamed);
break;
}
return base.OnOptionsItemSelected(item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment