Skip to content

Instantly share code, notes, and snippets.

@robotsquidward
Created September 30, 2020 12:47
Show Gist options
  • Save robotsquidward/4763911b3a7051ea233f7b67cd12a94b to your computer and use it in GitHub Desktop.
Save robotsquidward/4763911b3a7051ea233f7b67cd12a94b to your computer and use it in GitHub Desktop.
class MyActivity : AppCompatActivity() {
private val model: MyViewModel by viewModels()
override fun onCreate(savedInstanceState: Bundle?) {
model.getUsers().observe(this, Observer<List<User>>{ users ->
// update UI
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment