/**
* Created by Administrator on 2017/9/14 0014.
*/
public classUtilDownLoadAlertDialog {
private staticProgressDialogprocessDia;
/**
* 显示加载中对话框
*@paramcontext
*/
public static voidshowLoadingDialog(Context context,String message, booleanisCancelable) {
if(processDia==null) {
processDia=newProgressDialog(context,R.style.dialog);
//点击提示框外面是否取消提示框
processDia.setCanceledOnTouchOutside(false);
//点击返回键是否取消提示框
processDia.setCancelable(isCancelable);
processDia.setIndeterminate(true);
processDia.setMessage(message);
processDia.show();
}
}
/**
* 关闭加载对话框
*/
public static voidcloseLoadingDialog() {
if(processDia!=null) {
if(processDia.isShowing()) {
processDia.cancel();
}
processDia=null;
}
}
}