My scenario is initially I am loading a WebView and later on I am loading the same WebView with a different URL.
My problem is whenever I am loading the next URL I c
Thnx to StefanK comment found Here, You need to use the clearHistory()
method right when the page finishes loading in the WebViewClient
onPageFinished(WebView view, String url)
method also in the onLoadResource(WebView view, String url)
method; as follows:
myCoolWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url){
view.loadUrl(url);
return true;
}
@Override
public void onLoadResource(WebView view, String url) {
// Notice Here.
view.clearHistory();
super.onLoadResource(view, url);
}
@Override
public void onPageFinished(WebView view, String url) {
// And Here.
view.clearHistory();
super.onPageFinished(view,url);
}
});
Also you can check the canGoBack()
and copyBackForwardList()
for manipulations.