I am testing https://github.com/xamarin/xamarin-forms-samples/tree/master/UserInterface/Xaminals application on android 9.
I would like to know why the hardware back button does not work as expected (return to the previous view)
Example:
Example 2:
I'm not understanding why the hardware button only works correctly for example when I enter the detail of a cat and then I go back.
Android hardware back button by default closes the currently opened activity and activates an activity from the navigation stack. If you want to override this behavior, you need to handle the back button press and implement the navigation you need for your use case. Shell has this handy feature implemented with BackButtonBehavior property:
BackButtonBehavior
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/shell/navigation#back-button-behavior
2.1m questions
2.1m answers
60 comments
57.0k users