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
When calling the
by viewModels
lazy function from a fragment, if you passed in the owner and did not specify the factory i.e:the resulting viewModel would be created using the fragment's ViewModel factory instead of the owner's, which in this case is the activity's factory.
We should make sure that the
viewModels
function first uses the factory passed in, followed by the owner's, and if those are both null, only then does it fall back to the fragment's.