We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在onDestory里面调用disconnect,重新打开应用的时候,再次链接会多次触发onSocketConnectionSuccess,这个怎么解决
The text was updated successfully, but these errors were encountered:
您加我qq吧183459684,有可能你的Activity对象没有销毁,导致注册了多个监听器对象,你的监听器对象估计是个匿名内部类
Sorry, something went wrong.
在onDestroy生命周期里调用unregister方法, @OverRide protected void onDestroy() { super.onDestroy(); if (manager != null && manager.isConnect()) { manager.disConnect(); manager.unRegisterReceiver(adapter); manager = null; } } 或者监听器只随manager的创建绑定一次 manager = OkSocket.open(info); manager.registerReceiver(adapter);
完美解决,谢谢 @santosunny
Fixed #45
3675f99
No branches or pull requests
在onDestory里面调用disconnect,重新打开应用的时候,再次链接会多次触发onSocketConnectionSuccess,这个怎么解决
The text was updated successfully, but these errors were encountered: