in Cordova 1.8.1 - Android history.back() not working

荒凉一梦 提交于 2019-12-13 04:28:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!