How set alternate cell Color in a grid ? I\'ve found a lot of questions/tutorials about how to set row colors but nothing about cells\' color. Thanks in advance
If you got a lot of examples for listView, why not just use getView method, as getView method is used for adapter and adapter is used in both views, list and grid. just set background of view according to the position of view in adapterview.
protected void getView(AdapterView<> adapterView, View convertView, int position, long id)
{
LayoutInflater inflater = (LayoutInflater)context.getSystemService
(Context.LAYOUT_INFLATER_SERVICE);
View view =inflater.inflate(yourlayout.xml, null);
if(position%2==0)
view.setBackgroundColor(color1);
else
view.setBackgroundColor(color2);
return view;
}