Skip to Content
avatar image
-1
Former Member

How to disable browser back button or Android back button in sapui5 application?

The browser back buttton is navigating through the history of the app.How can we disable the back button to stop the user from using it.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 13, 2017 at 11:59 AM

    Hi Shashank,

    While navigating using navTo() function of route, pass the third parameter of the function as boolean true; doing so will not create any browser history and back button will be disabled; even if it is enabled it would not navigate you the App history, it will navigate to the last browser history. Below is the code example for the same.

    this.getOwnerComponent().getRouter().navTo("<ROUTE_NAME>", null, true);

    You can also refer to below API for more detail:

    https://sapui5.hana.ondemand.com/1.44.14/#docs/api/symbols/sap.ui.core.routing.Router.html#navTo

    Regards,

    Rahul

    Add comment
    10|10000 characters needed characters exceeded