Expandable listview group header color changes <p>I have set the two color for alternate group header in exapandable listview. But when I click multiple times to expand or collapse the color changes to any group row. </p> <p>Here is my code,</p> <pre><code> if (convertView == null) { LayoutInflater infalInflater = (LayoutInflater) this._context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = infalInflater.inflate(R.layout.list_group, null); if(groupPosition % 2 == 1) { convertView.setBackgroundColor(Color.parseColor("#3C3C3C")); }else { convertView.setBackgroundColor(Color.parseColor("#000000")); } } </code></pre> <p>This is happening after scrolling list. I have also tried this one</p> <pre><code>private int[] colors = new int[] { Color.parseColor("#000000"), Color.parseColor("#3C3C3C") }; int colorPos = groupPosition % colors.length; convertView.setBackgroundColor(colors[colorPos]); </code></pre>