Skip to Content

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

Oct 13, 2017 at 11:24 AM


avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Rahul Gupta 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:



Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Rahul

Thanks for your response but i found another way around