When developing WebApp with Oracle JET, the ojrouter is used, and the Ojrouter default contains the history push feature. When you debug Android, you will find that the return key is always returned to the last browsing record (the APP's record), which is unreasonable when used on the Android side.
Workaround:
1. The default history push feature is canceled when router is created. The document does not specify how to cancel, this method needs to be supplemented.
2. Call the Go method when using router, you can add the parameter go (' Stateid ', {historyupdate:skip}) to cancel the history push function when calling this method. But this only solves part of the problem, and it's not possible for each jump to be executed with go.
3. Change the return button to perform the task. Exit the app directly without returning the history.
1) Call Cordova to return button event handling. Document.addeventlistener ("Backbutton", Onbackkeydown, false);
2) Add the Onbackkeydown method. var onbackkeydown = function () {navigator.app.exitApp ();};
Here you can add two clicks to return before exiting the function.
Navigator.app object:
NAVIGATOR.APP.LOADURL () The application that loads the Web page or the system's default browser
NAVIGATOR.APP.CANAELLOADURL () cancel loading before the Web page loads successfully
Navigator.app.backHistory () returns to the previous browse page
Navigator.app.clearHistory () Empty browsing history
Navigator.app.clearCache () emptying the program's resource file cache
NAVIGATOR.APP.EXITAPP () Exit application
Navigator.app Object Reference site: http://tanglei528.blog.163.com/blog/static/43353399201401110738334/
Oracle JET Mobile Cordove Navigator.app objects