title: How to change textcolor of textview in listview depending on it's value?
body: <p>I'm having difficulties changing textview's textcolor in my listview.</p>
  
  <p>I have a row that consists of more than one textview but only one textview is visible.</p>
  
  <p>I want the text of that textview to change the color of textview depending on the other textview's value in that row. I'm pretty sure you'll understand what I mean when you see the code. </p>
  
  <pre><code>runOnUiThread(new Runnable() {
              public void run() {
                  /**
                   * Updating parsed JSON data into ListView
                   * */
                  ListAdapter adapter = new SimpleAdapter(
                          MainActivity.this, strojeviList,
                          R.layout.list_item, new String[] { TAG_SIFSTROJA,
                                  TAG_NAZIVSTROJA, TAG_AKTIVAN, TAG_AUTH,
                                  TAG_IP, TAG_POCETAK},
                          new int[] { R.id.sifstroja, R.id.nazivstroja, R.id.aktivan,
                                  R.id.auth, R.id.ip,R.id.pocetak});
                  // updating listview
                  setListAdapter(adapter);
               View v;
              TextView blab= (TextView)findViewById(R.id.tekst);
             blab.setTextColor(getResources().getColor(R.color.zelena));
  
               ListView lv=getListView();
  
                  TextView akt;
                  TextView naziv;
                  int bla=lv.getCount();
                  Log.d(TAG_AUTH,String.valueOf(bla));
                  for (int i = 0; i &lt; lv.getCount(); i++) {
                      v=(View) lv.getAdapter().getView(i,null,null);
                      akt = (TextView) v.findViewById(R.id.aktivan);
                      naziv=(TextView)v.findViewById(R.id.nazivstroja);
                      String aktiv=akt.getText().toString();
                      String aktivtekst=naziv.getText().toString();
  
                      Log.d(aktiv, aktiv);
                      if(aktiv.equals("1"))
                      {
                          Log.d("uso","uso sam");
                          Log.d("uso",aktivtekst);
  
                          naziv.setTextColor(getResources().getColor(R.color.zelena));
  
                      }
                      else {
                          Log.d("nisam aktivan","nisam aktivan");
                          Log.d("nisam aktivan",aktivtekst);
                          naziv.setTextColor(getResources().getColor(R.color.crvena));
                      }
                  }
  
  
              }
  </code></pre>
  
  <p>I can get textview values and if part works just fine but color is not changed, so what can I do to change the color?</p>