Last active
July 5, 2017 10:15
-
-
Save AkshayChordiya/327cccecd0c4bb1785bd31bea9390aa8 to your computer and use it in GitHub Desktop.
Simple ViewModel class with context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ContextViewModel(application: Application) : AndroidViewModel(application) { | |
/** | |
* The data | |
*/ | |
private var data: List<Data> | |
init { | |
// Load the data over here | |
// data = .... | |
} | |
/** | |
* Get all the data | |
*/ | |
fun getDataList() = data | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment