Last active
February 6, 2017 12:52
-
-
Save haydarai/9d46046642edcdd766485d50601b8d7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Post> posts = ...; // Fill the list with initial data | |
PostAdapter adapter = new PostAdapter(this, posts); // Initialize the RecyclerView Adapter | |
recyclerView.setAdapter(adapter); // Set adapter to the RecyclerView | |
/** | |
* Running some operation that modify the `posts` list | |
**/ | |
adapter.notifyDataSetChanged; // Notify the adapter that the `posts` list already changed, | |
// it can also substituted with `notifyItemInserted`, | |
// `notifyItemChanged`, `notifyItemRemoved`, etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment