问题
I am developing a phonegap application in which the app loads the external url(http://example.com) into webview. When I navigate through the screen using window.location.href. I cant able to go back to the previous screen using the soft back button that present in the webview itself. The android hard back button closes the back(which is fine for now).
Can anyone help me out.
回答1:
It is the same problem: If jquery mobile does not create history entries, the back-button from the android phone will terminate the app, because, there is no Activity to go back to.
If you go forwrd through your app, make a pushState: https://developer.mozilla.org/en-US/docs/DOM/Manipulating_the_browser_history
If you have history entries, your app will not close and hopefully the soft-back button will work.
来源:https://stackoverflow.com/questions/12608926/in-cordova-1-8-1-android-history-back-not-working