Android Dynamically load Listview at scroll end?

后端 未结 6 1917
梦毁少年i
梦毁少年i 2020-12-04 07:37

I am loading a listview from Http server, 20 at a time ,At the end of Listview I a want to load next 20 data from server and this process will continue till

6条回答
  •  情深已故
    2020-12-04 08:21

    Heiko Rupp's code is the best option for this problem. The only thing you should do is implement onScrollListener and in onScroll() just check if there is an end of list by using the code

    boolean loadMore =  firstVisibleItem + visibleItemCount >= totalItemCount-1;
    

    if true load your data with regular fashion..

    thaks Heiko Rupp for this snippet :)

提交回复
热议问题