Please note that using ListView.getScrollY() DOES NOT WORK WELL for restoring the scroll position.
See Android: ListView.getScrollY() - does it work?
It is referring to the scroll amount of the entire view, so it will almost always be 0.
It happened to me too most of the time that this value was 0.
ListView.getFirstVisiblePosition() with ListView.setSelection() works more reliably.