title: Android - Recycling listview elements automatically?
body: <p>I created a listview that has a custom SimpleCursorAdapter. I want to place a header in the first element in the list. 8 views fit on the screen at a time. When I scroll down to the ninth view, the header of the 1st element appears. At least I believe that is what is happening. I removed a button above the listview allowing all of the elements to appear on screen and only the first element had the header.</p>
  
  <p>I believe I am forcing a new view to be inflated each time. I have read up a bit on convertview and it appears to be something that you have to implement manually. </p>
  
  <pre><code>@Override
  public View newView(Context context, Cursor cursor, ViewGroup parent) {
  
      final LayoutInflater inflater = LayoutInflater.from(context);
      int position = cursor.getPosition();
      View v;
      v = inflater.inflate(R.layout.roster_lv_row_entry_with_header, parent, false);      
      if(position &gt; 0)
          v = inflater.inflate(R.layout.roster_lv_row_entry_no_header, parent, false);
  
      return v;
  </code></pre>