From 4d86317ec8c2f786f2dd3f674568b98a96f0e9b8 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 14 Feb 2023 14:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=91=E7=94=9F=E9=97=AA?= =?UTF-8?q?=E9=80=80=E6=97=B6=E4=BC=9A=E5=9B=9E=E5=88=B0=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E4=B8=94=E8=BF=9E=E4=B8=8D=E4=B8=8AIM=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yunbao/common/custom/TabButtonGroup.java | 3 +++ .../main/java/com/yunbao/main/activity/MainActivity.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/common/src/main/java/com/yunbao/common/custom/TabButtonGroup.java b/common/src/main/java/com/yunbao/common/custom/TabButtonGroup.java index 6f8d14c52..d2e0c7682 100644 --- a/common/src/main/java/com/yunbao/common/custom/TabButtonGroup.java +++ b/common/src/main/java/com/yunbao/common/custom/TabButtonGroup.java @@ -75,6 +75,9 @@ public class TabButtonGroup extends LinearLayout implements View.OnClickListener } } + public int getCurPosition() { + return mCurPosition; + } @Override public void onClick(View v) { diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 584273828..987edb8f7 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -312,6 +312,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene @Override public void onPageSelected(int position) { + if(mTabButtonGroup.getCurPosition()!=position){ + System.err.println("重连IM"); + RongcloudIMManager.connectIM(mContext.getApplication()); + position = 0; + mTabButtonGroup.setCurPosition(0); + } if (position != 0) { loadPageData(position, true); }