在程序中使用webview视图显示html页面。我想在页面加载时显示一个进度对话框。但是我加载页面后,没有显示进度对话框。我使用AsyncTask,进度对话框还是没有显示。我使用的以下代码:
class DownloadAysnc extends AsyncTask<String, String, Void>
{
ProgressDialog progressDialog;
@Override
protected void onPreExecute() {
super.onPreExecute();
progressDialog = ProgressDialog.show(OverView.this, "", "Please Wait ...");
}
@Override
protected Void doInBackground(String... arg0) {
webView.loadUrl("http://marico.com/html/investor/overview.php");
return null;
}
@Override
protected void onPostExecute(Void result){
super.onPostExecute(result);
progressDialog.dismiss();
}
}
如果我使用google文档显示web页面,html tag能显示,但是html页面不显示。下面的代码
String url = "http://google.co.in/";
String googleDocsUrl = "http://docs.google.com/viewer?url="+url;
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(googleDocsUrl ), "text/html");
startActivity(intent);
this.myWebView.loadUrl(googleDocsUrl);
请求大家的帮忙。