Answers for "how to identify adapter odd and even number android"

0

how to identify adapter odd and even number android

@Override
public void onBindViewHolder(ViewHolder holder, int position)
{
  if(position % 2 == 0) 
  {
     //holder.rootView.setBackgroundColor(Color.BLACK);
     holder.rootView.setBackgroundResource(R.color.black);
  }
  else 
  {
     //holder.rootView.setBackgroundColor(Color.WHITE);
     holder.rootView.setBackgroundResource(R.color.white);
  }
}
Posted by: Guest on February-15-2021

Code answers related to "how to identify adapter odd and even number android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language