예제 #1
0
 void OnBackPressed(object sender, ActivityEventArgs e)
 {
     if ((sender as IMenuItem).ItemId == global::Android.Resource.Id.Home)
     {
         FragmentManager.PopBackStack();
     }
 }
예제 #2
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            EventHandler <ActivityEventArgs> handler = OptionsItemSelected;

            if (handler != null)
            {
                var args = new ActivityEventArgs();

                foreach (EventHandler <ActivityEventArgs> @delegate in handler.GetInvocationList())
                {
                    @delegate(item, args);

                    if (args.Handled)
                    {
                        break;
                    }
                }
            }
            return(base.OnOptionsItemSelected(item));
        }