Android dynamic loading list view onScrollListener issues

后端 未结 3 2032
太阳男子
太阳男子 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条回答
  •  温柔的废话
    2020-12-21 04:28

    The above implementaion may cause errors at edge conditions. The sum of first visible item & items in page may be 1 count more or less than expected. I was using the same thing untill i switched to a new method. What i did was implemented a listener to the Adapter of listview and in the getview check if(position== totalItemCount of items in array to be displayed), if yes i call up my listener from adapter. Quite simple

提交回复
热议问题