修复发生闪退时会回到社区且连不上IM的问题

This commit is contained in:
zlzw 2023-02-14 14:42:58 +08:00
parent d36ece4c54
commit 4d86317ec8
2 changed files with 9 additions and 0 deletions

View File

@ -75,6 +75,9 @@ public class TabButtonGroup extends LinearLayout implements View.OnClickListener
}
}
public int getCurPosition() {
return mCurPosition;
}
@Override
public void onClick(View v) {

View File

@ -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);
}