Skip to content Skip to sidebar Skip to footer

Why ListView OnScroll() Gets Called Mutiple Times And Everytime WITH SAME ARGUMENT AMOUNTS?

I debugged several times. It's driving me crazy. My listView.onScroll() function gets called several times and every time with arguments all 0! Which causes the listView to show T

Solution 1:

From the developer's site about AbsListView.OnScrollListener:

Callback method to be invoked while the list view or grid view is being scrolled. If the view is being scrolled, this method will be called before the next frame of the scroll is rendered. In particular, it will be called before any calls to getView(int, View, ViewGroup).

The callback will be called in every frame. So it is not a good idea to use this method.

Alternately, you can implement a custom adapter in your listview and inside its getView() method check if the position variable point's to the last item on the list. If yes make the request.


Post a Comment for "Why ListView OnScroll() Gets Called Mutiple Times And Everytime WITH SAME ARGUMENT AMOUNTS?"