saving and restoring scrollbar position

by Stefan » Sat, 14 Mar 2009 02:11:15 GMT

Sponsored Links
I have an ExpandableListView with lots of elements in it. I need to
remember how much the list is scrolled, save it and later on restore
the list scrolled at the same position.
Because of that I have two problems:

First: how to get the scrolled coordinates?
I tried with getScrollX() and getScrollY(), but they are always
returning (0,0) . I also tried getGlobalVisibleRect(), no success

Second: Once I have the coordinates how do I restore them?
Again I tried using the provided scrollTo() and scrollBy() functions
(not with real values cause i can't get them). The list is scrolled,
great, but the scrollbar stays in its initial position, not great at
all. I again also tried requestRectangleOnScreen, but again no success

This tasks seems to me that should not be so difficult to accomplish,
but nevertheless I have no idea how to. Any help will be greatly


Other Threads

1. Selesai update f/w dan rooting gak bisa konek 3

pake kartu apa? soalnya SM1.0.3 itu XXJCE-based (FW Eropa) yang dimana ada
bug APN kalo dipasang sama 3 ato IM2.

Bisa diakali dengan mengcopy file dari punyanya DXJC4. Caranya
ada di


2. Continuously scrolling ListActivity


Is it possible to have a list activity that dosen't finish? i.e. if
you scroll to the end of the list then the start of the list begins

It's be best if you could also disable the scroll bar.

Thanks for your help!



3. Configuring automated build scripts

4. Selesai update f/w dan rooting gak bisa konek 3

5. EVO AVA-FROYO + Sense U

6. How should I do this?

7. NSPredicate-like functionality for Collections?