When using a navigation drawer (i.e. Hamburger Menu) in an Android App, the Xamarin Shell Navigation has for most users a confusing default behavior of the hardware back button.
Whenever I navigate to a page (FlyoutItem) from the menu and then hit the hardware back button, the app closes and the phone is back in the launcher screen. But I thought the back button should go to the last shown screen or the start screen.
Apps from Google, like the Play Store or Gmail or Album App from Sony will navigate back to the start screen of the app when hitting the hardware back button. Then hitting the back button on the start screen will close the app. This is my expected behavior of Shell navigation. Gmail and Album always show the hamburger menu icon, others replace hamburger by a back icon/arrow.
What would be a preferred way of getting to the start page when using hardware back button?
An option I thought so far is overriding the OnBackButtonPressed
in the xaml.cs
. Can the BackButtonBehavior
of Shell
be used?