Android v2.2-2.3.5: WebView : loadDataWithBaseURL : will only load page once
문제
When I'm loading a page using .loadData
or .loadDataWithBaseURL
, the system will load a page once.
After that, subsequent calls do not work.
In 4.0.3, if I were to call the function a second time with new data, it does change.
How can I fix this for 2.2+? Do I destroy the webview and create a new one?
webView1.loadDataWithBaseURL("file://", page, "text/html", "UTF-8", null);
webView1.loadUrl( "javascript:window.location.reload( true )" );
해결책
In loadDataWithBaseURL, set the last parameter to the URL where that data came from, instead of null
.
다른 팁
I think it should be "file:///"
. You just missed one slash.
제휴하지 않습니다 StackOverflow