From e8e118649814d350a0b7cd6cae546d72be6cc08f Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 7 Sep 2022 13:27:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=9D=E7=95=99=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E8=B7=B3=E8=BD=AC=E7=9B=B4=E6=92=AD=E9=97=B4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BD=86=E5=9C=A8=E5=BC=B9=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E6=A1=86=E5=89=8D=E5=88=A4=E6=96=ADActivity=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E9=94=80=E6=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/utils/DialogUitl.java | 20 +++++++++++++++++++ .../yunbao/main/activity/LoginActivity.java | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/yunbao/common/utils/DialogUitl.java b/common/src/main/java/com/yunbao/common/utils/DialogUitl.java index f309a0b24..a72d6cac7 100644 --- a/common/src/main/java/com/yunbao/common/utils/DialogUitl.java +++ b/common/src/main/java/com/yunbao/common/utils/DialogUitl.java @@ -75,6 +75,11 @@ public class DialogUitl { } public static void showSimpleTipDialog(Context context, String title, String content) { + if (context instanceof Activity) { + if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) { + return; + } + } final Dialog dialog = new Dialog(context, R.style.dialog2); dialog.setContentView(R.layout.dialog_simple_tip); dialog.setCancelable(true); @@ -105,6 +110,11 @@ public class DialogUitl { } public static void showSimpleDialog(Context context, String title, String content, boolean cancelable, SimpleCallback callback) { + if (context instanceof Activity) { + if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) { + return; + } + } new Builder(context) .setTitle(title) .setContent(content) @@ -115,6 +125,11 @@ public class DialogUitl { } public static void showSimpleDialog(Context context, String title, String content, boolean cancelable, SimpleCallback3 callback) { + if (context instanceof Activity) { + if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) { + return; + } + } new Builder(context) .setTitle(title) .setContent(content) @@ -125,6 +140,11 @@ public class DialogUitl { } public static void showSimpleInputDialog(Context context, String title, String hint, int inputType, int length, SimpleCallback callback) { + if (context instanceof Activity) { + if (((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) { + return; + } + } new Builder(context).setTitle(title) .setCancelable(true) .setInput(true) diff --git a/main/src/main/java/com/yunbao/main/activity/LoginActivity.java b/main/src/main/java/com/yunbao/main/activity/LoginActivity.java index d2eb1eab9..e7e0f27e8 100644 --- a/main/src/main/java/com/yunbao/main/activity/LoginActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/LoginActivity.java @@ -324,7 +324,7 @@ public class LoginActivity extends AbsActivity { home_zdy_img_cn = obj.getString("home_zdy_img_cn"); } MainActivity.forward(LoginActivity.this, false); - //gotoLive(obj.getString("anchor_id")); + gotoLive(obj.getString("anchor_id")); IMLoginManager.get(mContext).setisNewUserOne(true); IMLoginManager.get(mContext).setNewUserGif(true); if (obj.containsKey("home_zdy_pop")) {