修复密码登录界面点返回按钮时会回到桌面的问题

优化尝试重连im时检测到登录信息失效后返回到登录界面
This commit is contained in:
zlzw 2023-03-04 13:40:58 +08:00
parent 34432e5ccf
commit a1762bc791
2 changed files with 8 additions and 2 deletions

View File

@ -121,7 +121,8 @@ public class LoginActivity extends AbsActivity {
findViewById(R.id.btn_back).setOnClickListener(new View.OnClickListener() { findViewById(R.id.btn_back).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
finish(); //finish();
RouteUtil.forwardLauncher(LoginActivity.this);
} }
}); });

View File

@ -313,7 +313,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Override @Override
public void onPageSelected(int position) { public void onPageSelected(int position) {
if(mTabButtonGroup.getCurPosition()!=position){ if(mTabButtonGroup.getCurPosition()!=position){
System.err.println("重连IM"); System.err.println("重连IM:"+IMLoginManager.isLogin(mContext));
if(!IMLoginManager.isLogin(mContext)){
//IMLoginManager.get(mContext).setupLoginUser();
RouteUtil.forwardLoginInvalid("登錄失效");
return;
}
RongcloudIMManager.connectIM(mContext.getApplication()); RongcloudIMManager.connectIM(mContext.getApplication());
position = 0; position = 0;
mTabButtonGroup.setCurPosition(0); mTabButtonGroup.setCurPosition(0);