I am new in android , recently I have learned recyclerview and i want to change the color of rows.
recyclerview
Example: I have 10 rows and I want to change color like
Here is a solution :
LinearLayout ll_search =(LinearLayout)convertView.findViewById(R.id.ll_search); if(position %2 == 1) { ll_search.setBackgroundColor(Color.parseColor("#FFFFFF")); } else { ll_search.setBackgroundColor(Color.parseColor("#d3d3d3")); }