title: Android: ListView does not redraw when I scroll the ListView using scrollTo(x,y)
body: <ol>
  <li>My ListView is in the background (using a relative layout).</li>
  <li><p>I have a textbox which is used as a view in ListView, which is set to different background color for different lines. This is done using the following code in adapter.</p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent)
  {
  
      View rowView = convertView;
  
      if (rowView == null)
      {
          LayoutInflater inflater = ((Activity)context).getLayoutInflater();
          rowView = inflater.inflate(R.layout.listview_background, null);
          rowView.setTag(new ViewHolder((TextView) rowView.findViewById(R.id.listBackgroundTV)));
      }
  
      ((ViewHolder)rowView.getTag()).tv.setHeight((position != 0)?((CompareTextBox)((Activity)context).findViewById(R.id.ctb1)).getLineHeight():((CompareTextBox)((Activity)context).findViewById(R.id.ctb1)).getLineHeight() + (int) (context.getResources().getDisplayMetrics().density + 0.5f));
      ((ViewHolder)rowView.getTag()).tv.setBackgroundColor((b[position])?0xff000000:0xffffffff);
  
      return rowView;
  }
  </code></pre></li>
  </ol>
  
  <p>So you see the textbox background color is set using the position.</p>
  
  <ol start="3">
  <li>Now I use ListView.scrollTo(x,y) function to scroll the ListView upwards.</li>
  <li>Now, as the background of the textbox is calculated from the position, when the ListView is scrolled upwards, the correct color of the textbox should be displayed for the new rows displayed. But this is not happening. All the items in ListView exposed due to scrolling upwards have same black background.</li>
  </ol>
  
  <p>Any idea, how the ListView view can be refreshed/redrawn, or any issue spotted in the above code?</p>