Android Exit on Backbutton and Slide Menu on Menu Button
How manage both Android’s Back and Menu Button. So my question is split into 2.
First how to slide the app menu when the use clicks on device’s menu button (especially Samsung)?
The second issue is about the Mobile Device Back button (hardware) when clicking on it, it exists the application while it should return to homepage and if on homepage the client should click twice to exist.
For the hardware menu button I guess you have to check Cordova: https://cordova.apache.org/docs/en/latest/cordova/events/events.menubutton.html
About the back button, the default behavior of
ons-navigatoron device back button is to perform a
popPageif there are pages in the stack. If there are no previous pages then it exits the app. Are you using
ons-navigatoror something else?
Yes I’m using ons-navigator. Can’t we override the poppage and do action without an alert to the customer?
I’ll check the menu event behavior and try it.
@webiscore For now you can modify the
ons-pageback button handler since it has higher priority that the navigator one. You can use