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
Duplicate question and already answered here
Simply replace:
This:
boardViewModel = ViewModelProviders.of(this).get(BoardViewModel::class.java)
With this:
boardViewModel = ViewModelProvider(this).get(BoardViewModel::class.java)