CursorAdapter - List beheivour
<p>I use a CursorAdapter with one single customized layout for my list, depending on the value of a field (true or false) of my table, the color of one of the textviews in the list item will be different.</p>

<pre><code>public class CustomAdapter extends CursorAdapter {
    DatabaseHelper myDB;
    SQLiteDatabase db;

public CustomAdapter(Context context, Cursor cursor, int flags) {
    super(context, cursor, 0);
    myDB = new DatabaseHelper(context, DatabaseHelper.DB_NAME, null, DatabaseHelper.DB_VERSION_SCHEME);
    db = myDB.getReadableDatabase();
}

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    return LayoutInflater.from(context).inflate(R.layout.customize_cell_list, parent, false);
}

@Override
public void bindView(View view, Context context, Cursor cursor) {

    TextView tv = (TextView) view.findViewById(R.id.tv);
    TextView tv_date = (TextView) view.findViewById(R.id.tvDateCursor);
    TextView tv_time = (TextView) view.findViewById(R.id.tvTime);
    ImageView img = (ImageView)view.findViewById(R.id.img);

    if(cursor != null) {
        String tv = cursor.getString(2);
        String date = cursor.getString(3);
        String time = cursor.getString(8);
        boolean active = cursor.getInt(12) &gt; 0;
        boolean go = cursor.getInt(13) &gt; 0;

        tv_date.setText(date);
        tv.setText(tv);

        if(go) { // OPTION 1
            img.setImageResource(R.drawable.calle);
            tv_time.setText(time);

        } else { // OPTION 2
            img.setImageResource(R.drawable.casa);

            if(active){  // OPTION 2.1
                tv_time.setText("Activado");
            }else{  // OPTION 2.2
                tv_time.setText("No activado");
                tv_time.setTextColor(Color.RED);
            }
        }
    } 
}
}
</code></pre>

<p>The result: images display the correct one the same than the textviews, the problem is the color, when I have one item with the OPTION 2.2 and start scrolling up and down some of my tv_time (even from the option 1) begin to change the color to Red, then I scroll again and they become white and others change to red, it is something random.</p>

<p>Why is this happening? How can I keep the red color only when "go" and "active" are false?</p>

<p>Thanks</p>