I need to change the color of the listview item according to the data that comes from the database, I have a visited field that is receiving a "*" would like to change the color of the person that has already been visited.
I'm bringing the search this way:
players = new ArrayList();
var path = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), abrir.Nome_banco);
_connection = new SQLiteConnection(new SQLitePlatformAndroid(), path);
sqldb = SQLiteDatabase.OpenDatabase(path, null, DatabaseOpenFlags.OpenReadwrite);
sqldb = SQLiteDatabase.OpenOrCreateDatabase(path, null);
Android.Database.ICursor sqldb_cursor = null;
sqldb_query = "SELECT visitado,nome FROM pessoa where grupo_id ='"+grupo_id+"'order by nome asc";
sqldb_cursor = sqldb.RawQuery(sqldb_query, null);
if (!(sqldb_cursor != null))
{
}
if (sqldb_cursor.MoveToFirst())
{
do
{
//formando aqui
players.Add(sqldb_cursor.GetString(0) + sqldb_cursor.GetString(1));
} while (sqldb_cursor.MoveToNext());
}
Adapter code:
adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, players);
lv.Adapter = adapter;