Possible Duplicate:
Scrolling with Multiple ListViews for Android
I have two ListView
s and I need to scroll them together by just executing the scroll on one of the ListView
s.
I have set an OnScrollListener
on one of the ListView
s:
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
int scrollToThisPosition = firstVisibleItem;
index = firstListView.getFirstVisiblePosition();
View v = firstListView.getChildAt(0);
top = (v == null) ? 0 : v.getTop();
secondListView.setSelectionFromTop(index, top);
}
Everything works just fine, besides the fact that everything is very very slow.
Does this slowness happens to anybody else? The two ListView
s scroll smoothly without this "link" among each other, as I used the convertView
and the holder patterns in their rows' getView()
.