Android: ListView.getScrollY() - does it work?

android, scroll-offset

Solution

getScrollY() is actually a method on View, not ListView. It is referring to the scroll amount of the entire view, so it will almost always be 0.

If you want to know how far the ListView's contents are scrolled, you can use listView.getFirstVisiblePosition();

Problem

I am using it, but it always returns 0, even though I have scrolled till the end of the list.

Original source

Related problems