Q:

Mess while changing a Special item color

I want to change the color of a Special item in a recyclerview
I used the following code for this request but when there are too many items, I scroll down 
Background color of all other items also change
This case is in the normal recyclerview
What should I do to solve this problem?
My adapter code
public class LastCommentAdapter extends RecyclerView.Adapter<LastCommentAdapter.LastCommentViewHolder> {
private Context context;
private List<Comment> comments;
View view;

public LastCommentAdapter(Context context, List<Comment> comments) {
    this.context = context;
    this.comments = comments;
}

@Override
public LastCommentViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    view = LayoutInflater.from(context).inflate(R.layout.layout_last_comment_item, parent, false);
    return new LastCommentViewHolder(view);
}

@Override
public void onBindViewHolder(final LastCommentViewHolder holder, int position) {
    final Comment comment = comments.get(position);
    holder.commentUser.setText(comment.getName_user());
    holder.commentContent.setText(comment.getContent());
    holder.numberSubComment.setText(String.valueOf(comment.getNumber_sub_comment()));
    if (comment.getId()==7) {
        holder.itemView.setBackgroundColor(Color.BLUE);
    }
}

@Override
public int getItemCount() {
    return comments.size();
}

public class LastCommentViewHolder extends RecyclerView.ViewHolder {
    private TextView commentContent;
    private TextView commentUser;
    private TextView numberSubComment;

    public LastCommentViewHolder(View itemView) {
        super(itemView);
        commentContent = (TextView) itemView.findViewById(R.id.last_comment_item_content);
        commentUser = (TextView) itemView.findViewById(R.id.last_comment_item_user);
        numberSubComment = (TextView) itemView.findViewById(R.id.last_comment_item_answer);
    }
}

}

A:

You did correct but you also need to add the code for else statement because of the Id change. The issue is the special item is going to change and it's not getting the white background again because of else statement.
@Override
public void onBindViewHolder(final LastCommentViewHolder holder, int position) {
final Comment comment = comments.get(position);
holder.commentUser.setText(comment.getName_user());
holder.commentContent.setText(comment.getContent());
holder.numberSubComment.setText(String.valueOf(comment.getNumber_sub_comment()));
if (comment.getId()==(Special Item Id)) {
    holder.itemView.setBackgroundColor(Color.BLUE);
}else{
    holder.itemView.setBackgroundColor(Color.YOUR_COLOR);
}
}

