I am new to the mvvm pattern. I created a ViewModel for the main activity. Now I want to get an instance of the ViewModel in the main activity.
Most Tutorials and answe
Get ViewModel In New Way
MainActivityViewModel mainActivityViewModel; mainActivityViewModel= new ViewModelProvider(this).get(MainActivityViewModel.class);