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

fragment与activity生命周期关系的图有错误 #95

Open
Clearlee opened this issue Jan 24, 2018 · 1 comment
Open

fragment与activity生命周期关系的图有错误 #95

Clearlee opened this issue Jan 24, 2018 · 1 comment

Comments

@Clearlee
Copy link

我自己测试的log结果显示:Activity的onCreate先于fragment的onAttach执行。
onAttach方法会在Fragment于窗口关联后立刻调用,我认为窗口指的就是activity,如果窗口都没创建,怎么跟窗口进行关联。

@Clearlee
Copy link
Author

日志如下:
activity onCreate
fragment onAttach
fragment onCreate
fragment onCreateView
fragment onViewCreated
fragment onActivityCreated
fragment onStart
activity onStart
activity onResume
fragment onResume

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

1 participant