Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
findViewById(R.id.last_item_favorite_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//refresh last item
adapter.notifyItemChanged(adapter.getItemCount() - 1, "click1");
adapter.notifyItemChanged(adapter.getItemCount() - 1, "click2");
adapter.notifyItemChanged(adapter.getItemCount() - 1, "click3");
}
});
findViewById(R.id.all_item_favorite_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//refresh all item
adapter.notifyItemRangeChanged(0, adapter.getItemCount(), "click1");
adapter.notifyItemRangeChanged(0, adapter.getItemCount(), "click2");
adapter.notifyItemRangeChanged(0, adapter.getItemCount(), "click3");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment