4

Possible Duplicate:
Scrolling with Multiple ListViews for Android

I have two ListViews and I need to scroll them together by just executing the scroll on one of the ListViews.

I have set an OnScrollListener on one of the ListViews:

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 ListViews scroll smoothly without this "link" among each other, as I used the convertView and the holder patterns in their rows' getView().

Community
  • 1
  • 1
frapontillo
  • 10,499
  • 11
  • 43
  • 54

0 Answers0