/**
* 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);
? ? ? ? ? ?//點(diǎn)擊提示框外面是否取消提示框
? ? ? ? ? ? processDia.setCanceledOnTouchOutside(false);
? ? ? ? ? ?//點(diǎn)擊返回鍵是否取消提示框
? ? ? ? ? ? processDia.setCancelable(isCancelable);
? ? ? ? ? ?processDia.setIndeterminate(true);
? ? ? ? ? ?processDia.setMessage(message);
? ? ? ? ? ? processDia.show();
? ? ? }
}
? ? ?/**
? ? ?* 關(guān)閉加載對話框
? ? ?*/
? ? ?public static voidcloseLoadingDialog() {
? ? ? ? ? ? if(processDia!=null) {
? ? ? ? ? ? ? ? if(processDia.isShowing()) {
? ? ? ? ? ? ? ? ? ? ?processDia.cancel();
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ?processDia=null;
? ? ? ? ? ?}
? ? ?}
}