I am populating a ListView with a cursor adapter just like as described HERE:
DatabaseHelper databaseHelper = new DatabaseHelper(getActivity());
Cursor cursor = databaseHelper.getPeople();
String[] fromColumns = {"_id","firstname","lastname","email"};
int[] toViews = {R.id.count, R.id.firstname, R.id.lastname, R.id.email};
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.person_name_and_email, cursor, fromColumns, toViews, 0);
ListView listView = getListView();
listView.setAdapter(adapter);
I also have another column in my database table called "status" which is whether the person is "friend", "family", "business associate", etc.
I am going to use the content of this column to determine the color of the person row; if the person is a friend, the row will be green, if the person is family, the row will be blue, etc.
So, I do not want the "status" data to show up in the ListView as a column, but I need it for each row I iterate through.
Is there a way to do this?
Thanks!
Try Overriding the getView() method