我想在我的应用程序中显示进度对话框,直到它加载 URL 并显示它。但它没有显示进度对话框。请帮我。
setContentView(R.layout.activity_main);
mywb = (WebView) findViewById(R.id.webView);
ProgressDialog progressDialog = new ProgressDialog(this);
progressDialog.setTitle("The Book Street");
progressDialog.setMessage("Loading");
progressDialog.setProgressStyle(progressDialog.STYLE_SPINNER);
progressDialog.show();
progressDialog.setCancelable(false);
WebSettings webSettings = mywb.getSettings();
webSettings.setJavaScriptEnabled(true);
mywb.loadUrl("http://www.thebookstreet.com");
progressDialog.dismiss();
mywb.setWebViewClient(new WebViewClient());
相关分类