fix:保留首次进入跳转直播间功能,但在弹对话框前判断Activity是否销毁

This commit is contained in:
zlzw 2022-09-07 13:27:56 +08:00
parent 12221c3ddc
commit e8e1186498
2 changed files with 21 additions and 1 deletions

View File

@ -75,6 +75,11 @@ public class DialogUitl {
} }
public static void showSimpleTipDialog(Context context, String title, String content) { 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); final Dialog dialog = new Dialog(context, R.style.dialog2);
dialog.setContentView(R.layout.dialog_simple_tip); dialog.setContentView(R.layout.dialog_simple_tip);
dialog.setCancelable(true); dialog.setCancelable(true);
@ -105,6 +110,11 @@ public class DialogUitl {
} }
public static void showSimpleDialog(Context context, String title, String content, boolean cancelable, SimpleCallback callback) { 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) new Builder(context)
.setTitle(title) .setTitle(title)
.setContent(content) .setContent(content)
@ -115,6 +125,11 @@ public class DialogUitl {
} }
public static void showSimpleDialog(Context context, String title, String content, boolean cancelable, SimpleCallback3 callback) { 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) new Builder(context)
.setTitle(title) .setTitle(title)
.setContent(content) .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) { 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) new Builder(context).setTitle(title)
.setCancelable(true) .setCancelable(true)
.setInput(true) .setInput(true)

View File

@ -324,7 +324,7 @@ public class LoginActivity extends AbsActivity {
home_zdy_img_cn = obj.getString("home_zdy_img_cn"); home_zdy_img_cn = obj.getString("home_zdy_img_cn");
} }
MainActivity.forward(LoginActivity.this, false); MainActivity.forward(LoginActivity.this, false);
//gotoLive(obj.getString("anchor_id")); gotoLive(obj.getString("anchor_id"));
IMLoginManager.get(mContext).setisNewUserOne(true); IMLoginManager.get(mContext).setisNewUserOne(true);
IMLoginManager.get(mContext).setNewUserGif(true); IMLoginManager.get(mContext).setNewUserGif(true);
if (obj.containsKey("home_zdy_pop")) { if (obj.containsKey("home_zdy_pop")) {