title: ListView with section header problem
body: <p>Hi I'm adding section headers for my listView, there are few methods on the web. Since I'm using simpleCursorAdapter to manage my listView, I adopted phil bogle's method. <a href="http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/" rel="nofollow noreferrer">http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/</a> </p>
  The error occurred at this part of the code: </p>
  
  <pre><code>    listAdapter.setViewBinder( new SimpleCursorAdapter.ViewBinder()
      {
          public boolean setViewValue(View view, Cursor cursor, int
                                     columnIndex)
          {
                if (columnIndex == nDateIndex) {
                  if (isHeaderVisible(cursor)) {
                      view.setVisibility(View.VISIBLE);
                       prevDate = dateString;
                      ((TextView) view).setText(dateString);
                  } else {
                      ((TextView) view).setText("");
                      view.setVisibility(View.GONE);
                  }
                  return true;
              }
              return false;
          }
      });
  </code></pre>
  
  <p>This is the LogCat shows how they compare while I scroll up the list:  </p>
  
  <pre><code>09-06 11:06:43.460: INFO/System.out(563): Sun, 05 Sep 2010 11:41:53  (dateString)
  09-06 11:06:43.460: INFO/System.out(563): Wed, 01 Sep 2010 21:58:06  (preDate)
  09-06 11:06:43.460: INFO/System.out(563): 120.0                      (record)
  09-06 11:06:43.820: INFO/System.out(563): Sun, 05 Sep 2010 17:47:26  (dateString)
  09-06 11:06:43.820: INFO/System.out(563): Sun, 05 Sep 2010 11:41:53  (preDate)
  09-06 11:06:43.820: INFO/System.out(563): 112.0                      (record)
  </code></pre>
  
  <p>The correct output should be:<br>
       <strong>Sun, 05 Sep 2010</strong><br>
       <strong>112<br>
       120</strong> </p>
  
  <p>But when I scroll up, the setViewValue calls 120 first and compare with preDate(show above), it becomes:<br>
      <strong>Sun, 05 Sep 2010<br>
      112<br>
      Sun, 05 Sep 2010<br>
      120</strong>  </p>
  
  <p>So how can I make the section headers fixed after creating the headers? Why setViewBinder been called while scrolling? Any suggestions on this? Thanks!      </p>