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

WorkflowFragment using deprecated onActivityCreated() #1122

Closed
ychescale9 opened this issue May 2, 2020 · 2 comments · Fixed by #1133
Closed

WorkflowFragment using deprecated onActivityCreated() #1122

ychescale9 opened this issue May 2, 2020 · 2 comments · Fixed by #1133
Labels
enhancement New feature or request kotlin Affects the Kotlin library. points: 1

Comments

@ychescale9
Copy link
Contributor

WorkflowFragment is starting workflow in onActivityCreated() which is deprecated in AndroidX Fragment 1.3.0.

Should we move the initialization to onViewCreated() instead?

I'm ready to send a PR:)

@zach-klippenstein zach-klippenstein added kotlin Affects the Kotlin library. points: 1 proposal Issue or PR that proposes something and invites comment on whether or not it's a good idea. enhancement New feature or request and removed proposal Issue or PR that proposes something and invites comment on whether or not it's a good idea. labels May 2, 2020
@zach-klippenstein
Copy link
Collaborator

We should definitely not be relying on deprecated APIs. I don't think there's any logic in that method that actually relies on that particular lifecycle event, but @rjrjr should confirm. If there is, we can use the onAttach LifecycleObserver trick mentioned in that PR, otherwise we can probably do what you've proposed.

If you want to submit a PR, that would be great! I would hold off for Ray's confirmation though to make sure you're not doing wasted work. Thanks for filing!

@rjrjr
Copy link
Contributor

rjrjr commented May 4, 2020

Doing it in onViewCreated would get view persistence out of order:

     * Called immediately after {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)}
     * has returned, but before any saved state has been restored in to the view.

onViewStateRestored looks like a better proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kotlin Affects the Kotlin library. points: 1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants