title: Android + ListView background sets background while scrolling?
body: <p>I have a ListView that's populated via an ArrayAdapter.  Within the adapter, i set the view background color dependent on a conditional.  It works, but while scrolling the remaining rows adopt this color.  Here's some code:</p>
  
  <pre><code>class DateAdapter extends ArrayAdapter&lt;DateVO&gt; {
      private ArrayList&lt;DateVO&gt; items;
      public ViewGroup listViewItem;
  
      //constructor
      public DateAdapter(Context context, int textViewResourceId, ArrayList&lt;DateVO&gt; items) {
          super(context, textViewResourceId, items);
          this.items = items;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          try {
              if (view == null) {
                  LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                  convertView = vi.inflate(R.layout.row, null);
              }
  
              final DateVO dateItem = items.get(position);
  
              if (dateItem != null) {
  
                  //is this my issue here? does position change while scrolling?
                  if(items.get(position).getField().equals("home")){
                      view.setBackgroundResource(R.drawable.list_bg_home);
                  }
                  ...
              }
  
          }catch (Exception e) {
              Log.i(ArrayAdapter.class.toString(), e.getMessage());
          }
  
          return view;
      }
  } 
  </code></pre>