Hello. I am writing an application for work, which is a list of points with the ability to sort by day of the week, and by "mine are not mine" .. I redefined the SimpleCursorAdapter method to change the color of rows. But I would like to make this change depending on the My parameter or not, and not on the parity of the position .. The parameter "my" is stored in SQLite as "1" in the "isMy" column. I can not figure out how to get this value in the adapter ..
public class MyCursorAdapter extends SimpleCursorAdapter { public MyCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags) { super(context, layout, c, from, to, flags); } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = super.getView(position, convertView, parent); if (position % 2 == 0){ view.setBackgroundColor(Color.rgb(238, 233, 233)); } else { view.setBackgroundColor(Color.rgb(255, 255, 255)); } return view; }