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")) {