title: how does scrolling in android listview work?
body: <p>I have an android-app with a listview in an activity. The listview has, if I call it so, three data states.</p>
  
  <ol>
  <li>no data loaded from inet -> only one dummy item is visible, saying that data is loading;</li>
  <li>data is loaded and shown in list;</li>
  <li>one listitem is clicked and now shows more information for this listitem (so it is increased in its height).</li>
  </ol>
  
  <p>On every state change (1 -> 2, 2 -> 3), I call notifyDataSetChanged() on this ListAdapater.
  This causes the listview to scroll down to the last item. This is ugly in the first transition and even more ugly in the second because the clicked list item is now out of focus.</p>
  
  <p>As I can see, this happens with a google g1 with android 1.6. An htc touch with the same sdk acts like desired (I will try to figure it out with some more devices).</p>
  
  <p>To avoid this, I tried to read out getScrollY() and set this value back. but this returns 0. The reason for this return value I already found on stackoverflow in other questions.</p>
  
  <p>Has anyone else seen this problem? Why does the listview scroll to the last item? It was mentioned that listview keeps track of the scroll position. but it seems that it does not in my case.</p>
  
  <p>Or maybe I am calling the wrong refresh method? Is notifyDataSetChanged the correct one?</p>