can I get some better understanding on what viewMo...
# android-architecture
b
can I get some better understanding on what viewModelFactory does please. ty
👍 1
😶 1
v
ViewModelFactory it is a factory class that creates ViewModel objects and configure them so they can survive configuration changes. If you create your object like any other regular the ViewModel won’t be aware of the activity lifecycle, does that makes things a bit more clear?
https://developer.android.com/codelabs/kotlin-android-training-view-model#0 This might be a good exercise to dive deeper into ViewModel
m
Vmfactory males More isolated the instantiation of viewmodels, with things such as passing parameters and enhancing the Ui testing of the viewmodels 👍