Skip to Content
-1

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

Oct 13, 2017 at 11:24 AM

287

avatar image
Former Member

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

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

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

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

Hi Rahul

Thanks for your response but i found another way around

0