EDIT: I worked on this project years ago and unfortunately I cannot verify if any of the answers is working in the given scenario.
I am having hard time with one Web
I was facing the same issue. I was creating a new Webview everytime. Just first destroy your previous webView before creating a new one. I hope this help!! Make your webview a global variable. Like -
Webview w;
then before creating a new webview just destroy the previous one
if(null != w)
{
//destroy the previous webview, before creating the new one
w.destroy();
}
w= new WebView(activity);
I have spent the last day or so working on an application that utilised a WebView. I did have a few issues with loading data into the WebView.
I am not entirely sure this would work but perhaps replace this code:
public void reLoadUrl() {
wv.loadUrl(Constants.BLOG_URL);
}
with this code:
public void reLoadUrl() {
wv.clearView();
wv.loadUrl(Constants.BLOG_URL);
}
maybe when you clear the WebView it will solve the issue
I had the same issue, calling resumeTimers() solved the problem for me...
Try to load a blank page before:
wv.loadUrl("about:blank");
wv.clearHistory();
wv.clearView();
wv.loadUrl(Constants.BLOG_URL);
Edit: This is a code I used before because I had problems with this too, please try it.
I'd suggest you try recreating the WebView
every time you use it and see if that makes any difference.
First save context, layout parms and parent.
Context context = wb.getContext();
ViewGroup.LayoutParams lp = wv.getLayoutParams();
ViewGroup parent = (ViewGroup)wv.getParent();
Then stop it loading and remove the view from its parent.
wv.stopLoading();
parent.removeView(wv);
Then recreate and add it back.
wv = new WebView(context);
parent.addView(wv, lp);
That may be other properties that you'll need to restore, but that's the general idea.
I am facing the same issue and got it working by following steps:
webView.clearCache(true);
webView.loadUrl("Url");
and I got the multiple url loaded successfully.