I want to change the color of a TextView
inside my Activity
s ListView
by java code. ListView
contains multiple rows which are fed by a MatrixCursor
and an ArrayAdapter
. The color of the TextView
should be green or white which should be determined by an if
clause. How can I accomplish this?
citem = NameManager.getciList();
NameManager.WriteName(citem);
MatrixCursor cursor;
cursor = NameManager.getnameList();
startManagingCursor(cursor);
if (cursor.getString(9).equals("yes")){
//TODO set color of R.id.name color here
}
String[] from = { "name", "info", "status", "path", "folder", BaseColumns._ID };
int[] to = { R.id.name, R.id.info, R.id.status, R.id.path };
final SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.row, cursor, from, to);
setListAdapter(adapter);