Skip to content

Instantly share code, notes, and snippets.

@shkschneider
Last active November 27, 2018 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shkschneider/e43845ad58473a57ff286fbab31442d0 to your computer and use it in GitHub Desktop.
Save shkschneider/e43845ad58473a57ff286fbab31442d0 to your computer and use it in GitHub Desktop.
private val viewModel by lazy {
ViewModelProviders.of(this).get(MainViewModel::class.java)
}
// inside onCreate()
viewModel.getUsers().observe(this, Observer {
display(it)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment