ViewModelFactory is use to initialize the ViewModel
VaibhavMojidra/Android-Java---Demo-View-Model-Factory
The ViewModelFactory is a class in the Android Architecture Components that is used to create instances of ViewModel classes. In Android, a ViewModel is used to store and manage data that is used in an activity or fragment, and survives configuration changes, such as screen rotation.
Java