Take the 2-minute tour ×  'In the below android list adapter I
wish to dynamically change the colour in the display of an
element based on a condition, for example if TAG_AMOUNT is
greater than 2 then the text view is red. Any help welcome! (the
below is based on androidhive JSON parsor)'  protected void
onPostExecute(String file_url) { // dismiss the dialog after
getting all products // updating UI from Background Thread
runOnUiThread(new Runnable() {     public void run() {     *
Updating parsed JSON data into ListView     * */     ListAdapter
adapter = new SimpleAdapter(         AllProductsActivity.this,
productsList,         R.layout.list_item, new String[] {
TAG_PID,TAG_NAME, TAG_AMOUNT, TAG_LOCATION},        new int[] {
R.id.pid, R.id.name, R.id.amount, R.id.location});
// updating listview share|improve this question  1 Answer 1  up
vote 1 down vote accepted  Yes you can do this by Customizing
SimpleAdapter class.  Here is sample code for the same.  What
you basically will be doing