创建进度对话框的几种方式
1、调用ProgressDialog的静态方法show()
ProgressDialog.show(this, "进度对话框", "请等待...", false, true);
2、创建ProgressDialog对象,通过方法进行设置,然后show出来
ProgressDialog pd=new ProgressDialog(MainActivity.this);
pd.setTitle("进度对话框");
pd.setMessage("请等待...");
pd.setCancelable(false);//设置对话框能否用back键取消
pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);//设置对话框风格
pd.show();