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 can see the previously loaded URL contents and then my currently loaded URL contents gets displayed.
I want to clear the contents whenever I am loading the different URL.
Say,
if (pos == 0) {
mweb.clearCache(true);
mweb.clearHistory();
mweb.loadUrl("http://stackoverflow.com/");
}
else if (pos == 1) {
mweb.clearCache(true);
mweb.clearHistory();
mweb.loadUrl("http://android.stackexchange.com/");
}
Both clearCache()
and clearHistory()
does not work for me.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…