WebView Back, Refresh, Forward? Simply doesn't work!

人走茶凉 提交于 2019-11-30 20:53:16

The code you shared doesn't include the portion where you are creating webview and navigating between urls. So I am just taking a guess at what might be happening.

It seems that webview is an instance field of your class whose portion you have shown in the question. Could it be that webView is being recreated every time you navigate to a new page? That is, the code is something like:

webview = new WebView(this);
webview.loadUrl("http://slashdot.org/");

If this is what is being done, all you need is to create the 'webView' once and just call loadUrl everytime you need to navigate to new url. This way the webview instance will be able to retain the history.

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