Skip to content

Instantly share code, notes, and snippets.

@ashishrawat2911
Last active August 26, 2018 12:55
Show Gist options
  • Save ashishrawat2911/a0c1bb901e64acdaa51b28b51a67ed2e to your computer and use it in GitHub Desktop.
Save ashishrawat2911/a0c1bb901e64acdaa51b28b51a67ed2e to your computer and use it in GitHub Desktop.
PhotographersViewModel model = ViewModelProviders.of(this).get(PhotographersViewModel.class);
model.getPhotographer().observe(this, new Observer<List<Photographer>>() {
@Override
public void onChanged(@Nullable List<Photographer> photographerList) {
adapter = new PhotographerAdapter(MainActivity.this, photographerList);
recyclerView.setAdapter(adapter);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment