首页 > 代码库 > Android webview 显示进度条

Android webview 显示进度条

代码:

ProgressDialog dialog = null;/** * 嵌入浏览器 */private void embedBrowser(String url) {    Log.i(TAG, url);    WebView browser = (WebView) this.findViewById(R.id.c131_webkit);    if (browser != null) {        wifi = new WifiService(this);        if (wifi.isNetworkConnected()) {            browser.setWebViewClient(new WebViewClient() {                //已经加载完成                @Override                public void onPageFinished(WebView view, String url) {                    super.onPageFinished(view, url);                    dialog.dismiss();                }            });            browser.loadUrl(url);            dialog = ProgressDialog.show(this, null,                    getString(R.string.progressBarLoading));            browser.reload();        } else {            Toast.makeText(WebkitActivity.this, R.string.no_wifi, 100)                    .show();        }    } else {        Toast.makeText(WebkitActivity.this, R.string.no_webkite, 100)                .show();    }}