title: set different color on each listview row
body: <p>I have seen related answers and I do not know ehich one is the appropriate for me.
  I have a listView and each row has a textview. I want given some conditions, each row to get different color.(Imagine that I am getting data from a DB, and given the value I get, i want text set to different color) My code is shown below:</p>
  
  <pre><code>public class TrailsConditionScreen extends ListActivity {
   public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          seeTrails();
      }
   private void seeTrails() {
      String[] help=new String[] {"foo","bar"};
      ArrayAdapter&lt;String&gt; adapter=new ArrayAdapter&lt;String&gt;(this,R.layout.row,R.id.text1,help);
      setListAdapter(adapter);
   }
  </code></pre>
  
  <p>}
  This code so far just prints them on the list.</p>
  
  <p>Now I want when retrieving values from the db, given the value i get set a different color on each row. imagine that my codes retrieves data from a table an I want when reading the first line , given the number set the appropriate color on the first line of the listview. Then go to second lone of the db,set color for the second line of the list and so on.. i have successfully implemented the reading from the db but i do not know how to set color on specific row. In pseudo-code it looks like this.</p>
  
  <pre><code> for i=0 to number of lines in db{
     read_data();
     if key_value=0 then color_of_line(i)=red;
    else color_of_line_i)=green;
  }
  </code></pre>
  
  <p>Any help for this?</p>