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

网络请求后没有判断activity是否销毁,如果销毁了再修改界面不会导致崩溃吗? #47

Closed
liu-xinhui opened this issue Oct 22, 2020 · 4 comments

Comments

@liu-xinhui
Copy link

之前都是用rxjava或者livedata,destroy后就不更新界面了。这个框架都没有使用,直接网络请求后更新界面,如果此时activity已经destory了,不会导致崩溃吗?

@getActivity
Copy link
Owner

@getActivity
Copy link
Owner

@liu-xinhui
Copy link
Author

原来是网络请求框架自动处理呀,牛逼

@getActivity
Copy link
Owner

EasyHttp 用到了 Jetpack 中的 Lifecycle 特性来做请求的生命周期管控,在 AndroidX 包下的 AppCompatActivity 和 Fragment 都是 LifecycleOwner 的子类,所以无需自己封装。

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