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

请问下,presentFragment之后fragment的生命周期怎么不调用呢 #56

Open
w1984908499 opened this issue Jun 5, 2023 · 3 comments

Comments

@w1984908499
Copy link

要在什么地方可以调用fragment的生命周期呢

@listenzz
Copy link
Owner

listenzz commented Jun 5, 2023

? fragment 的生命周期必然是调用的,如果没有,就是 BUG 了。譬如 A present B,B 是会经历 onCreateView 等生命周期的。你的问题是什么呢?哪些生命周期没有执行?能否描述清楚点。

@w1984908499
Copy link
Author

是我想的简单了,应该是嵌套Fragment的可见性处理,viewpage+fragment(其中再嵌套子fragment),这种情况下,子fragment的生命周期就不调用了

@listenzz
Copy link
Owner

可见性使用 onResumeonPause 来处理,使用 ViewPager2 而不是 ViewPager。

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