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

关于unregister是否调用的问题(1.0.4 ) #16

Closed
lixi0912 opened this issue Jun 9, 2015 · 5 comments
Closed

关于unregister是否调用的问题(1.0.4 ) #16

lixi0912 opened this issue Jun 9, 2015 · 5 comments

Comments

@lixi0912
Copy link

lixi0912 commented Jun 9, 2015

我在LoginActivity注册了User实体类的回调事件(当接收到User实体类时,则认为登录成功,在其他页面接收到的时候,则刷新当前页面),LoginActivity在接收到User之后,弹出Toast告知用户已经登录成功,并且finish掉自己.期望LoginActivity在onDestroy后,能即时的注销回调,不再接收User事件.然而
这时候有可能出现Subscriber还没有被回收的情况.出现再次触发了已经onDestroy的LoginActivity..
不符合初期的期望,...这不禁让我有些疑惑.当Activity的onDestroy执行之后,Subscriber什么时机会被系统回收呢? 是否又会因此影响到之前的代码逻辑,以及unregister定位于过时方法是否合理?

小子的代码不漂亮,如果有时间请多多指教~

@hehonghui
Copy link
Owner

@lixi0912 使用unregister进行注销,unregister在下次更新将去除deprecated注解。

@lixi0912
Copy link
Author

lixi0912 commented Jun 9, 2015

@bboyfeiyu 已经使用unregister注销 不胜感激

@hehonghui
Copy link
Owner

@lixi0912 已经更新了,可以帮测试一下。另外你们公司的产品上线了么 ?

@lixi0912
Copy link
Author

@bboyfeiyu 好的,这个版本还没有

@zijianwang90
Copy link

现在把前面所有删掉的unregister又都加回来了

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

No branches or pull requests

3 participants