Why do we need ViewModelFactory?
Answer
The ViewModel class allows data to survive device-configuration changes such as screen rotations and changes to keyboard availability. You use the ViewModelFactory class to instantiate and return the ViewModel object that survives configuration changes.
Answer
The ViewModel class allows data to survive device-configuration changes such as screen rotations and changes to keyboard availability. You use the ViewModelFactory class to instantiate and return the ViewModel object that survives configuration changes.