1
- 網頁視圖
- 重定向URL
- 網頁流量負載重定向URL
- 的WebView怎麼知道重定向URL負載完成?
我想你想這個方法..
final ProgressDialog dialog = new ProgressDialog(this);
WebView webView = (WebView) findViewById(R.id.webView);
webView.loadUrl(yourUrl);
webView.setWebChromeClient(new WebChromeClient());
webView.setWebViewClient(new WebViewClient(){
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
dialog.show();
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
dialog.hide();
}
});