update RecyclerView with Android LiveData
Like @Lyla said, you should observe the whole list as LiveData in Fragment or Activity, when receive changes, you should set the whole list to the adapter by DiffUtil. Fake code: PostViewModel { LiveData<List<Post>> posts; // posts comes from DAO or Webservice } MyFragment extends LifecycleFragment { PostAdapter postAdapter; … void onActivityCreated() { … postViewModel.posts.observer(this, … Read more