Get ViewModel ViewModelProvider.Factory and Application Context

Keywords´╝Ü android mvvm viewmodel android-jetpack android-viewmodel


I am extending AndroidViewModel to get an application context in my ViewModel but Now I also want to pass some parameters to my ViewModel. After some google search, I came to know that I can use ViewModelProvider.Factory to get Parametrized constructor of my MyViewModel but how to get an application context.

Thanks in advance.