So I do have my custom `ListView` with `TextView` on the left and `ImageView` on the right side. It shows products that can be checked favourite. So when the product is favourite it shows light star and when not it shows dark star.

Everthing works fine expect of the first row. When first row is selected as favourite everything works fine. But when it is selected non-favourite, then it still has a light star when any other product has also light star. In order to set firsts star colour to dark, I need to set all the products non-favourite.

I tried to debug it, but my logs show that everything is fine... I can't find any reasonable answer why this happens to me so I came here. I post some of code.

**Adapter**

```
public class ProductsWithFavAdapter extends ArrayAdapter<Products>{
private Activity context;
private List<Products> products;
public ProductsWithFavAdapter(Activity context, List<Products> products) {
    super(context, R.layout.product_with_fav, products);
    this.context = context;
    this.products = products;
}

private class ViewHolder {
    public TextView productName;
    public ImageView imageFav;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder viewHolder;
    View rowView = convertView;
    if(rowView == null) {
        LayoutInflater layoutInflater = context.getLayoutInflater();
        rowView = layoutInflater.inflate(R.layout.product_with_fav, null, true);
        viewHolder = new ViewHolder();
        viewHolder.productName = (TextView) rowView.findViewById(R.id.textView1);
        viewHolder.imageFav = (ImageView) rowView.findViewById(R.id.imageView2);
        rowView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) rowView.getTag();
    }
    Products product = products.get(position);

    if(product.isFav()) {
        viewHolder.imageFav.setImageResource(R.drawable.fav_light);
        Log.d("AdaptFAV " + Integer.toString(position) + " " + product.getName(), Integer.toString(product.isFav() ? 1 : 0) + " SET LIGHT");
    } else {
        viewHolder.imageFav.setBackgroundResource(R.drawable.fav_dark);
        Log.d("AdaptFAV " + Integer.toString(position) + " " + product.getName(), Integer.toString(product.isFav() ? 1 : 0) + " SET DARK");
    }

    viewHolder.productName.setText(product.getName());

    return rowView;
}

```

**Activity**

```
products.clear();
            favProductsTriggered = !favProductsTriggered;

            String searchProductText = searchProduct.getText().toString();
            boolean searchingProduct = false;

            if(!searchProductText.equals("") && !searchProductText.isEmpty()) {
                searchingProduct = true;
            }

            ProductsDbAdapter adapterProducts = new ProductsDbAdapter(getActivity());
            adapterProducts.open();
            final Cursor cursorProducts = adapterProducts.getAllProducts();

            if(cursorProducts != null && cursorProducts.moveToFirst()) {
                do {
                    int id = cursorProducts.getInt(ProductsDbAdapter.ID_COLUMN);
                    String name = cursorProducts.getString(ProductsDbAdapter.NAME_COLUMN);
                    boolean fav = cursorProducts.getInt(2) != 0;
                    products.add(new Products(id, name, 0, 0, fav));
                    Log.d("wwFAV " + Integer.toString(cursorProducts.getPosition()), Integer.toString(cursorProducts.getInt(2)));
                } while(cursorProducts.moveToNext());
            }

            ProductsWithFavAdapter listProductsAdapter = new ProductsWithFavAdapter(getActivity(), products);
            lvProducts = (ListView) ll.findViewById(R.id.listView3);
            lvProducts.setAdapter(listProductsAdapter);

```

And for now, logs. When they show that:

```
AdaptFAV 0 bułka pszenna: 0 SET DARK
AdaptFAV 1 płatki owsiane: 1 SET LIGHT
AdaptFAV 2 bułka jęczmienna: 1 SET LIGHT

```

then first position is still LIGHT because second and third are. I need to set second and dark to dark in order to set first dark. :(