Skip to content

Instantly share code, notes, and snippets.

@gonzalonm
Last active October 17, 2018 11:45
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 gonzalonm/170ba174ef28d01bc0036804e54c21e6 to your computer and use it in GitHub Desktop.
Save gonzalonm/170ba174ef28d01bc0036804e54c21e6 to your computer and use it in GitHub Desktop.
ArticleViewModel viewModel = ViewModelProviders.of(this).get(ArticleViewModel.class);
viewModel.loadArticles().observe(this, new Observer<List<Article>>() {
@Override
public void onChanged(@Nullable List<Article> articles) {
recyclerView.setAdapter(new ArticleAdapter(articles));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment