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

onActivityCreated与onSupportVisible时序有时候不对 #475

Closed
bangelua opened this issue Aug 3, 2017 · 3 comments
Closed

onActivityCreated与onSupportVisible时序有时候不对 #475

bangelua opened this issue Aug 3, 2017 · 3 comments

Comments

@bangelua
Copy link

bangelua commented Aug 3, 2017

我继承了SupportFragment,在onActivityCreated初始化了一些东西,onSupportVisible内调用初始化的变量方法发生crash。看了下是onSupportVisible先于onActivityCreated执行了。

@bangelua
Copy link
Author

bangelua commented Aug 3, 2017

找到原因了,如果子类要继承onActivityCreated,必须在方法最后调用super.onActivityCreated(savedInstanceState);父类方法会执行回调onSupportVisible

@YoKeyword
Copy link
Owner

@bangelua 嗯,onSupportVisible()目前一些情况会在onActivityCreated()调用,但是确定会在onCreateView()之后调用, 这个后面再优化,保证统一性

@YoKeyword
Copy link
Owner

v1.1.1已放出,调用顺序规范:onActivityCreated() -> onResume() -> onSupportVisible -> onLazyInitView() => onSupportInvisible() -> onPause()

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