This has a reference to Xamarin Forums thread named Setting toolbar to link back button override action is failing in XF.Android.
I have two sample projects. One XF_NavBarBackBtnOverride works fine in both Android and iOS. The other XF_NavBarBkBtnOver doesn't work in Android but works in iOS. (In VS 2019 I was not able to add an existing solution to GitHub. I will have to dig further into this issue).
Here is the procedure and explanations for XF_NavBarBackBtnOverride project that works fine:
In App.xaml.cs:
a) MainPage = new NavigationPage(new MainPage());
b) As usual MainPage is displayed.MainPage.xaml (a normal ContentPage):
a) Click on "Open Second Page" button.
b) In the Click event: await Navigation.PushAsync(new Page1());
c) This opens the "Second Page" (Page1.xaml).Page1.xaml (a normal ContentPage)
a) Click on the "Open Third Page" button.
b) In the Click event: await Navigation.PushAsync(new Page2());
c) This opens the "Third Page" (Page2.xaml).Page2.xaml (a BackButtonCustomActionPage)
a) Click on the Back Arrow of Navigation Bar at top left.
b) Then OnOptionsItemSelected event in the MainActivity.cs is invoked.
c) This in-turn invokes the CustomBackButton event handler declared in the constructor of Page2.
d) That displays the Alert "... ... want to go back?".
Here is the procedure and explanations for XF_NavBarBkBtnOver which doesn't work in Android:
In App.xaml.cs:
a) MainPage = new NavigationPage(new MainPage());
b) As usual MainPage is displayed.MainPage.xaml (a normal TabbedPage):
a) The MainPage consists of 3 tabs.
b) The first tab titled "Page 1" is displayed on start. Stay in this page.Page1.xaml (a normal ContentPage) of first tab:
a) Click on "Add" Toolbar Item at top right of Navigation Bar.
b) In the Click event: await Navigation.PushAsync(new Details());
c) This opens "Details Page".Details.xaml (a BackButtonCustomActionPage):
a) Click the Back Arrow of Naviagtion Bar at the top right.
b) Then OnOptionsItemSelected override event in the MainActivity.cs should be invoked.
c) That event is not invoked and control is not passed to that event.