I have a listView and adapter :
resultAdapter = new SimpleCursorAdapter(getActivity(),
R.layout.custom_products_list, null, new String[] {
StoreData.Product.NAME,
StoreData.Product.PRICE,
StoreData.BrandRecord.NAME3 }, new int[] {
R.id.productItem, R.id.productPItem,
R.id.productBItem }, 0){
@Override
public View getView(int position, View convertView,
ViewGroup parent) {
View viewGroup=super.getView(position, convertView, parent);
if (position % 2 == 0)
viewGroup.setBackgroundResource(color.even_row_color);
else
viewGroup.setBackgroundResource(android.R.color.background_light);
//viewGroup.setClickable(true);
return viewGroup;
}
};
This is to make two colors list. Everything work ok, I have list with two colors items. But when I click on any item from list push effect disapear. I want to see effect like in basic listview when I click on item I want to change his color. How I can do that?
Try to make your changes to
convertViewand return it: