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

Backstack is not available in a child Fragment's onCreate after process death #275

Open
Zhuinden opened this issue Apr 25, 2023 · 0 comments

Comments

@Zhuinden
Copy link
Owner

Currently, the general usage is to use onViewCreated, however the only reason why it's unavailable in onCreate is that internally, the Backstack is maintained by a platform retained fragment.

Although on second thought, as Fragment.onCreate is executed by Activity's super.onCreate after process death, it wouldn't have a state changer, so calling lookupService on it then would have also failed anyway.

Still, this means that Fragment.onCreate is kind of a liability. Not sure what can be done about this other than saying "use onViewCreated instead" or do a handler.post. Most likely just documentation issue, as this is fragment design (I don't think we need to recreate services until the state changer is set).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant