Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
A couple of questions:
1. Have you saw crash in real device or only in simulators?
2. Do you use dynamic feature for language ID?
1. Have you saw crash in real device or only in simulators?
2. Do you use dynamic feature for language ID?
jb...@google.com <jb...@google.com> #3
Tested on Android 12 Emulator with custom executor, but cannot repro this issue.
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.