Refreshing current webview's URL is not a common usage.
I used this in such a scenario: When user goes to another activity and user come back to webview's activity I reload current URL like this:
public class MyWebviewActivity extends Activity {
WebView mWebView;
....
....
....
@Override
public void onRestart() {
String url = mWebView.getUrl();
String postData = MyUtility.getOptionsDataForPOSTURL(mContext);
mWebView.postUrl(url, EncodingUtils.getBytes(postData, "BASE64"));
}
}
You can also use WebView's reload()
function. But note that if you loaded the webview with postUrl()
, then mWebView.reload();
doesn't work. This also works
String webUrl = webView.getUrl();
mWebView.loadUrl(webUrl);