Android dynamic loading list view onScrollListener issues

后端 未结 3 2035
太阳男子
太阳男子 2020-12-21 03:52

I have implemented a list view, every user scroll to bottom screen, it auto add new data to list view Once the scroll has completed, onScroll() call for every new item that

3条回答
  •  旧时难觅i
    2020-12-21 04:28

    To detect the item at the bottom of the screen you have to work with firstVisibleItem and visibleItemCount. I had created a demo example for the same using AsyncTask that will loading items in background and update the UI.

    Total of firstVisibleItem and visibleItemCount will give you the number of items that are loaded and then you can implement the logic of loading more items.

    int loadedItems = firstVisibleItem + visibleItemCount;
    

提交回复
热议问题