| package com.dayu.henanlibrary.view; | 
|   | 
| import android.app.Activity; | 
| import android.app.Dialog; | 
|   | 
| import com.tencent.bugly.crashreport.CrashReport; | 
|   | 
| /** | 
|  * Created by Android Studio. | 
|  * author: zuo | 
|  * Date: 2023-11-22 | 
|  * Time: 13:33 | 
|  * 备注: | 
|  */ | 
| public class ProgressDialog { | 
|     static Dialog dialog; | 
|   | 
|     public static void show(Activity activity) { | 
|         try { | 
|             dialog = android.app.ProgressDialog.show(activity, "", "正在通信请稍后", true, true); | 
|         } catch (Exception e) { | 
|             e.printStackTrace(); | 
|         } | 
|     } | 
|   | 
|     public static void dismiss() { | 
|         try { | 
|             if (dialog != null && dialog.isShowing()) { | 
|                 dialog.dismiss(); | 
|                 dialog = null; | 
|             } | 
|         } catch (Exception e) { | 
|             e.printStackTrace(); | 
|             CrashReport.postCatchedException(e); | 
|         } | 
|     } | 
| } |