Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
ap...@google.com <ap...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
il...@google.com <il...@google.com> #4
We've added this Lint check internally and it will be available in Fragment 1.2.0-rc01
an...@google.com <an...@google.com> #5
pa...@gmail.com <pa...@gmail.com> #6
It seems the FragmentLiveDataObserve lint check is missing cases for, when one uses the observe extension function and not the observe function found on the LiveData class.
I created a repohttps://github.com/patrickusiewicz/missing-lint-check-for-observe to show the issue.
I created a repo
il...@google.com <il...@google.com> #7
Re #6 - please file a separate issue.
l....@gmail.com <l....@gmail.com> #8
Comment has been deleted.
Description
Version used: 1.2.0-alpha01
Devices/Android versions reproduced on:
Observing a LiveData in OnViewCreated using this as the LifecycleOwner can lead to unexpected behaviors on fragment re-attachment.
Instead, getViewLifecycleOwner() should be used as the LifecyclerOwner.
Having a Lint check that warns when a LiveData is observed with this inside a Fragment could help the new users of Fragment and LiveData.