I was using this android list view tutorial (it shows how to display database entries in a list view), and I was thinking about changing color of the entries from database, is it possible to change color of every row ? For example Germany will be red, Spain yellow etc. and the color will depend on the string?
// map each name to a TextView
String[] from = new String[] { "countryname" };
int[] to = new int[] { R.id.countryTextView };
conAdapter = new SimpleCursorAdapter(Countrylist.this, R.layout.country_view, null, from, to);
setListAdapter(conAdapter); // set adapter
You can achieve through custom adapter,
In the custom adapter getView method, you can set the background for the textView based on your condition
Please find the references,
http://android.cyrilmottier.com/?p=454