how to use viewmodelprovider isteadof viewModelproviders code example
Example: replace ViewModelProviders.of android x
JAVA
replace :
customViewModel = ViewModelProviders.of(this).get(CustomViewModel.class);
with:
customViewModel = new ViewModelProvider(this).get(CustomViewModel.class);
KOTLIN
replace:
customViewModel = ViewModelProviders.of(this).get(CustomViewModel::class.java)
with:
customViewModel = ViewModelProvider(this).get(CustomViewModel::class.java)