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

为什么不需要removeObserver了? #1

Open
lt19931203 opened this issue Jun 21, 2021 · 1 comment
Open

为什么不需要removeObserver了? #1

lt19931203 opened this issue Jun 21, 2021 · 1 comment

Comments

@lt19931203
Copy link

你好,看了你在掘金发布的文章,https://juejin.cn/post/6960914424865488932。为什么一开始调用了owner.lifecycle.removeObserver(this)。但是最后的版本中却移除了,是不用考虑泄露问题吗?

@MoonLoong
Copy link

没有必要removeObserve显式调用,这是官方解释:https ://github.com/googlecodelabs/android-lifecycles/issues/5

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

2 participants