我想通过java代码更改TextView
s Activity
内ListView
的颜色。 ListView
包含多行,由MatrixCursor
和ArrayAdapter
提供。 TextView
的颜色应为绿色或白色,应由if
子句确定。我怎么能做到这一点?
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);