title: Problem with getListView().getFirstVisiblePosition()
body: <p>I'd like to have my application do some on-screen changes (outside the ListView) based on what the first visible item in my list is.</p>
  
  <p>What I've done is override the onScroll handler.  When this handler is invoked, I set the position of my Cursor to the first visible position so I can look at the data for that row:</p>
  
  <pre><code>        public void onScroll(AbsListView view, int firstVisibleItem,
                  int visibleItemCount, int totalItemCount) {
              mCursor.moveToPosition(getListView().getFirstVisiblePosition());
              ...
  </code></pre>
  
  <p>I then reference the data in the Cursor to make my display changes.</p>
  
  <p>Here's the thing:  This working is spotty.  Most of the time it works perfectly.  I can't make it screw up.</p>
  
  <p>However, sometimes getListView().getFirstVisiblePosition() does not return 1 until the 3rd item (index 2) is really the first visible item.  It displays 0 when the 0 index is showing.  It displays 0 when the 1 index is showing.  It displays 1 when the 2 index is showing and so on.  Additionally, it only does this when the user is scrolling down the list.  If the user is scrolling backwards (up), getFirstVisiblePosition() returns the correct value.</p>
  
  <p>I'm wondering if this isn't related to some efficiency problem.  This handler is going to execute over and over and over as the user scrolls.</p>
  
  <p>Does anyone have any ideas on what could be the problem?  Does anyone have any better solutions?</p>
  
  <p>Update:</p>
  
  <p>Do I remember hearing that getFirstVisiblePosition() is really only a guess; and that Android essentially supposes what index might be available by rows' probable height?  If this is so, then I have a problem.  Some rows in my list are bigger than others.  If this is the case, is there any way around it?</p>