Here's the scenario: I've got a simple ListView displaying a twitter feed. I have a CursorAdapter which is fetching tweets from sqlite. When I call requery() on my cursor, I expect that new tweets will be fetched that have since been added to the database. This all works fine, and the new items are even visible in the ListView after this happens.
The Problem is the scroll position seems to be saved based on the item position offset. So let's say the first visible position in my ListView is 4. When I requery and 2 new items are added to the top of the list, the ListView keeps the first visible item scroll position as 4, however since there's two new items in the list, I now see a different item at position 4 than before I refreshed. This image illustrates the before and after:
Notice how Before, Tweet D is the first visible item and afterwards, Tweet B now becomes the first visible item.
My Question is, how do I keep the same scroll position based on cursor positon when calling requery, so that in this example, Tweet D would still be the first visible item after a requery?