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 adding the stateless aosp/1859226 it used the
SavedStateViewModelFactory
constructor inAndroidViewModelFactory
under the hood, which meant that when using the statelessSavedStateViewModelFactory
and creating aViewModel
viaCreationExtras
, it required anApplication
to be set.Having an
Application
should not be a requirement for creating aViewModel
using theSavedStateViewModelFactory
or theAndroidViewModelFactory
. We should fix the behavior of theAndroidViewModelFactory
to rely on theNewInstanceFactory
when no application is available, just like theSavedStateViewModelFactory
used to.