I need to be able to browse quite a few items in my list (like
500,000). So I decided to use a strategy similar to the product list
in android market -- a "Loading..." item at the end of the list which
initiates downloading of more items when reached.

However, if the user keeps scrolling for a while, the items can become
too many to keep in memory (or even on the sdcard), so I made my
adapter use a circular buffer for the items with a capacity of 1000.
When the capacity is exceeded, new items overwrite the oldest items.
Then, I put a "Loading..." item at the front of the list as well, so
that discarded items can be downloaded again if the user scrolls back
to the top of the list.

I would like to keep the current scroll position unchanged when I add
new items. This seems to be the case when the capacity is not reached.
But when I reach the capacity and the oldest items are removed from
the adapter the list gets scrolled to the bottom which initiates the
loading of new items and this goes on forever. It seems that I need to
somehow compensate for the removal of items by scrolling up with the
sum of their heights. Is this a correct way of solving this problem?
How do I get the heights of the items?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to