I have two ListViews. Is there any way to synchronize the position of ListViews when I scroll both the Lists
Asked
Active
Viewed 2,326 times
0
-
I have a working sollution please check this post http://stackoverflow.com/questions/11906263/how-to-syncronisize-two-listview-positions/16168749#16168749 – EvertvdBraak Apr 23 '13 at 11:58
2 Answers
1
Use the following method to get the scroll position of your first listView-
private void saveListScrollPosition()
{
// save index and top position
index = _listview1.getFirstVisiblePosition();
View view = _listview1.getChildAt(0);
top = (view == null) ? 0 : view.getTop();
}
And scroll the second listView to that position with-
// restore
_listview2.setSelectionFromTop(index, top);

Rajkiran
- 15,845
- 24
- 74
- 114
0
You could use this in your second list view: smoothScrollToPosition(position)
And in your first ListView you could use a OnScrollListener and check the first visible item with getFirstVisiblePosition.
Best wishes, Tim

Tim
- 6,692
- 2
- 25
- 30
-
have you tried with the above solution .since i didnt get scrolling with the same idea – Sundar_Mob Mar 20 '12 at 08:21