Skip to Content

SAPUI5 navigation using browser or android back button

May 16, 2017 at 08:35 AM


avatar image

My SAPUI5 app is working fine. The navigation using the navButton is ok. But within use navigation on browser or Android back button, the app navigate though the history.

How can I disable these navigation leaving only my app's navigation?

10 |10000 characters needed characters left characters exceeded

Hi Muhammed,

Did you find any solution to this? I have a similar requirement but I am not able to figure it out.



* Please Login or Register to Answer, Follow or Comment.

1 Answer

Aarti Dhamat May 22, 2017 at 08:21 AM


Disabling browser's default behavior is not a good idea, however you can prevent it by using window.history.forward() on browser.

If you are using phonegap or cordova, you can add event listener document.addEventListener("backbutton", funName, false) on deviceready.

Hope this helps.



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

Hi Aarti,

Can you tell how to call window.history.forward() in this case?

I mean how will I get the reference when the browser back button is clicked and then how will I trigger a function(or event) for this.

Best Regards,



Hi Ankur,

For browser: you can add some function with code "window.history.forward() in head section of the page which will prevent browser's default back button behavior.

For Device: If you are using hybrid app in Cordova/Phonegap then you can add listener for native back button of the device as per my previous comment.

Let me know if it works for you.


Aarti Dhamat