title: change ListView row colors based on TextView in item
body: <p>Evening Everyone,</p>
  
  <p>making a simple budget app and want a red background of the row when it is a cost and a green background when it is an income.  Have the listview working and everything, now just delving into the colors.  Already figured out changing row colors for on click but now looking to have an "initial" coloring of the rows. (this is my first app so still very much learning)</p>
  
  <p>I have tried - custom SimpleAdapter wrapper:</p>
  
  <pre><code>public class RC_Adapter extends SimpleAdapter {
  Context contextpass;
  
  public RC_Adapter(Context context, List&lt;? extends Map&lt;String, ?&gt;&gt; data,
          int resource, String[] from, int[] to) {
      super(context, data, resource, from, to);
      contextpass = context;
      // TODO Auto-generated constructor stub
  }
  @Override
  public View getView(int position,View convertView,ViewGroup parent){
      TextView tv = (TextView) convertView.findViewById(R.id.c1);
      String s = tv.getText().toString();
      if(s.equals("Cost")){
          convertView.setBackgroundResource(R.color.valencia_red);}
      else{
          convertView.setBackgroundResource(R.color.t_green);
      }
      return convertView; 
  }
  }
  </code></pre>
  
  <p>Implemented with:</p>
  
  <pre><code>RC_Adapter sd=new RC_Adapter(this,arrCosts,R.layout.costlist,
                           new String[]{"id","desc","cost"},
                           new int[]{R.id.c1,R.id.c2,R.id.c3});
  </code></pre>
  
  <p>I have also tried:</p>
  
  <pre><code>SimpleAdapter.ViewBinder binder = new SimpleAdapter.ViewBinder() {
  
          @Override
          public boolean setViewValue(View view, Object data,
                  String textRepresentation) {
              // TODO Auto-generated method stub
              TextView tv = (TextView) view.findViewById(R.id.c1);
              String s = tv.getText().toString();
              if(s.equals("Cost")){
                  view.setBackgroundResource(R.color.valencia_red);}
              else{
                  view.setBackgroundResource(R.color.t_green);
              }
              return false;
          }
      };
      sd.setViewBinder(binder);
  </code></pre>
  
  <p>Both just crash the program as soon as I call the functions that initiate the changed simpleadapters. I have not tried calling both at once.  I tried the extended class and then I tried the binder.  Are there obvious mistakes in the code?  I have been trying to adapt multiple different things to get it to work (like <a href="https://stackoverflow.com/questions/8212137/change-color-of-an-item-in-listview-with-simpleadapter">Change color of an item in ListView with SimpleAdapter</a>)</p>
  
  <p>Thanks for any help! Always appreciated</p>