В kotlin Я свежее, пожалуйста, дайте мне знать об этом
//In onBindViewHolder method :
val context = holder.itemView.context
//Here I want to change background colour so please tell me or comment
if (position % 2 == 0) {
holder.binding.root.setBackgroundColor(ContextCompat.getColor(context,R.color.colorAccent))
} else {
holder.binding.root.setBackgroundColor(ContextCompat.getColor(context,R.color.colorPrimary))
}
Заранее спасибо.!