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. 3D UI framework like clutter on android

Hello all,

Are there any plans to add a 3D UI framework like Clutter on to
android which helps in developing 3D objects and animation easily and
also exploit opengles support at the backend.


2. HTMLViewer

When you email yourself a PDF or Office file, you can click Preview
and it opens up with HTML Viewer.

Is there a way to launch this process (HTMLViewer etc) without having
to email yourself the files?


3. how to get focus in AlarmClock

4. Socket problems: broken pipe

5. Trying to understand LocationListener.

6. Is it possible to launch another app's main activity just by changing manifest.xml?

7. How to copy file from apk raw folder