From a89c441555606ad79d499cae883c1bdbffb77cb0 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sat, 4 Mar 2023 13:56:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=86=E7=A0=81=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=95=8C=E9=9D=A2=E6=8C=89=E7=89=A9=E7=90=86=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=8C=89=E9=92=AE=E6=97=B6=E4=BC=9A=E5=9B=9E=E5=88=B0?= =?UTF-8?q?=E6=A1=8C=E9=9D=A2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/yunbao/common/utils/RouteUtil.java | 9 +++++++++ .../java/com/yunbao/main/activity/LoginActivity.java | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java index 34a1be8cd..c8a3c2645 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -75,6 +75,15 @@ public class RouteUtil { .withBoolean("forwardEntry", true) .navigation(); } + /** + * 只回到登录页,不提示东西 + */ + public static void forwardEntry2() { + ARouter.getInstance().build(PATH_ENTRY) + .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + .navigation(); + } /** * 跳转到个人主页 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 0709595e3..17e9aaae5 100644 --- a/main/src/main/java/com/yunbao/main/activity/LoginActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/LoginActivity.java @@ -122,7 +122,7 @@ public class LoginActivity extends AbsActivity { @Override public void onClick(View view) { //finish(); - RouteUtil.forwardLauncher(LoginActivity.this); + RouteUtil.forwardEntry2(); } }); @@ -380,4 +380,10 @@ public class LoginActivity extends AbsActivity { super.onDestroy(); } + + @Override + public void onBackPressed() { + super.onBackPressed(); + RouteUtil.forwardEntry2(); + } }