Skip to content

Instantly share code, notes, and snippets.

Last active Oct 28, 2018
What would you like to do?
Article 2, Point 1.2
class BooksFragment : Fragment() {
override fun onActivityCreated(savedInstanceState: Bundle?) {
viewModel = ViewModelProviders.of(this).get(
viewModel.liveData.observe(viewLifecycleOwner, Observer { updateViews(it) }) // Usually what we want: Passing Fragment's view as LifecycleOwner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment