I have adjusted my repository to make it a protected variable. Great idea!

The MainViewModel is not required in this example. I included it in order to have a clear separation between the view logic in the Activity and the “Business logic” in the MainViewModel. Per your suggestion, passing in the repository into the MainViewModel; the reason I’m injecting the repository in the MainViewModel is to keep the “Business logic” apart from the UI in the MainActivity.

Creator of Coinverse - The 1st Crypto News Audiocast App @ bit.ly/play-coin

Creator of Coinverse - The 1st Crypto News Audiocast App @ bit.ly/play-coin