NavigationClick of android Toolbar not working ?

Hi all,

I have added toolbar in android using appcompact support libarary. and added custom back navigation icon.
but it navigation click is not occuring.
below is my code.

Android.Support.V7.Widget.Toolbar toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
//toolbar.InflateMenu(Resource.Menu.menu);
SetSupportActionBar(toolbar);
toolbar.Title = title;

        toolbar.SetNavigationIcon(Resource.Drawable.back);
        toolbar.NavigationClick += (object sender, Android.Support.V7.Widget.Toolbar.NavigationClickEventArgs e) =>
        {

            Finish();
        };

I am not getting event of NavigationClick.

Please Help

Answers

  • LoriLalondeLoriLalonde CAInsider, University, Developer Group Leader ✭✭✭

    Override the OnOptionsItemSelected event. This is what is triggered when tapping the icon in the Toolbar.

Sign In or Register to comment.