Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Component used: Fragment
Version used: 1.6.2
The issue #137122478 had requested a lint rule for enforcing the use of viewLifecycleOwner when observing a FragmentLiveDataObserve rule in android lint.
LiveData
inFragment
s. We then got theShould we enforce the same when observing
Flow
s inFragment
s as well and create a similar rule?For example, if we have a
ViewModel
exposing auiState: StateFlow<T>
:The corresponding
Fragment
should ideally useviewLifecycleOwner
's scope instead of theFragment
's scope? i.e.: