我已经使用进度条来指示页面正在加载 android webview。但是,即使在页面完全加载后,进度条也会永远显示。我使用 logcat 进行调试,显示调用了 onPageFinished 函数。
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// TODO Auto-generated method stub
_dialog =ProgressDialog.show(UmlScreen.this, "", "Please wait...");
super.onPageStarted(view, url, favicon);
_dialog.setCanceledOnTouchOutside(true);
Log.d("LOGCAT", "started");
}
@Override
public void onPageFinished(WebView view, String url) {
// TODO Auto-generated method stub
super.onPageFinished(view, url);
if (_dialog != null || _dialog.isShowing()) {
_dialog.dismiss();
Log.d("LOGCAT", "finished");
}
}