Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android端切换账号问题 #15

Open
JmStefanAndroid opened this issue Aug 25, 2019 · 1 comment
Open

Android端切换账号问题 #15

JmStefanAndroid opened this issue Aug 25, 2019 · 1 comment

Comments

@JmStefanAndroid
Copy link

注销之前的账号,然后登录新的账号,发现无法回调登录成功,异步请求登录是成功的
另外, 不杀应用,直接去注销账号,然后登录,无法实现,AsyncTask不执行

`new AsyncTask<Object, Integer, Integer>() {
@OverRide
protected Integer doInBackground(Object... params) {
int code = -1;
Log.w(TAG, "loginout");
try {
code = LocalUDPDataSender.getInstance(context).sendLoginout();
} catch (Exception e) {
Log.w(TAG, e);
}

            //## BUG FIX: 20170713 START by JackJiang
            // 退出登陆时记得一定要调用此行,不然不退出APP的情况下再登陆时会报 code=203错误哦!
            IMClientManager.getInstance(context).resetInitFlag();
            //## BUG FIX: 20170713 END by JackJiang

            return code;
        }

        @Override
        protected void onPostExecute(Integer code) {
            if (code == 0) {//成功
                Log.d(TAG, "注销成功");
                doLoginIm(((Context) mView).getApplicationContext(), true);
            } else {//注销失败
                Log.d(TAG, "注销失败");
            }
        }
    }.execute();`
@JackJiang2011
Copy link
Owner

不会的,一定是你调用有问题,你把这个帖子里,以及我在帖子里的回复都仔细看看,理解一下:
http://www.52im.net/thread-1302-1-1.html

另外,你可以体验一下RainbowChat(它就是基于MobileIMSDK实现),它的切换账号功能:https://fir.im/vg2b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants