I have a layout with two EditText and an ImageView that will be added to the ListView via BaseAdapter. I wanted to toggle the background color of the ListView in zebra. The problem is that if the ListView has more than 9 lists the zebra effect starts to work wrong. To change the color of the ListView I am using the formula:
if(position % 2 == 0){
layout.setBackgroundColor(Color.YELLOW);
}