Skip to content

Instantly share code, notes, and snippets.

@luthfihariz
Created August 1, 2018 00:26
Show Gist options
  • Save luthfihariz/1923138c6ea8e2f5dcb127048de92a80 to your computer and use it in GitHub Desktop.
Save luthfihariz/1923138c6ea8e2f5dcb127048de92a80 to your computer and use it in GitHub Desktop.
ViewModel & LiveData
class EventListViewModel : ViewModel(){
val eventList = MutableLiveData<List<Event>>()
init {
eventList.postValue(arrayListOf(Event("Google IO 2018"),
Event("Droidcon London 2018"),
Event("GOTO Berlin 2018")))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment