使用和取消时调用下面的两个方法
private ProgressDialog pBar;
private void showWaitingDialog() {
pBar = new ProgressDialog(this);
pBar.setTitle("Title");
pBar.setMessage("请稍等...");
pBar.setProgressStyle(ProgressDialog.STYLE_SPINNER);
pBar.show();
}
private void cancelDialog() {
if (pBar != null && pBar.isShowing()) {
pBar.cancel();
pBar = null;
}