title: How set text/image of specific one ListView row - Android?
body: <p>Thanks to help from stackoverflow users I have managed to change colour of one specific row based on some condition. But changing colour doesn't fully fit my needs and expectations.</p>
  
  <p>So I started looking through web and trying to change it. I want to set text in TextView of specific row. To be able to change row colour I was advised to create personalised SimpleCursorAdapter class as I am getting values into ListView from SQLite using Cursor.</p>
  
  <p>After reading and testing it this is what I came up with:</p>
  
  <pre><code>public class MyCursorAdapter extends SimpleCursorAdapter {
      public MyCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) {
          super(context, layout, c, from, to);
      }
  
      @Override
      public void bindView(View view, Context context, Cursor cursor) {
          super.bindView(view, context, cursor);
          if(cursor.getLong(cursor.getColumnIndex(MyDBAdapter.KEY_PRICE)) == 5)
          {   
              TextView price = (TextView)view.findViewById(R.id.priceInfo);
              price.setText("High");
          }
          else
              view.setBackgroundColor(0x00000000);
      }
  }
  </code></pre>
  
  <p>However, what I am getting now is duplicated text on some rows (there is regularity in it). As I read somewhere, every scroll is refreshing ListView, but how it is possible that when I put in if clause (insted of this TextView) this line: <code>view.setBackgroundColor(SELECTED_COLOR);</code> everything works fine and only this one row had been changed.</p>
  
  <p>Can someone please tell me what I have to do to make it works, or what is wrong in my thinking?</p>