简体   繁体   中英

Android simultaneously use Pull to Refresh ListView at the top and automatically Load more data when scroll to the Bottom

Please read it carefully before marking it as duplicate . I am using pulltorefresh from this library and I am implimenting pulltorefresh on the top of screen using following code:

listView.setMode(Mode.PULL_FROM_START);

Now i also want to use ListView automatically Load more data when scroll to the Bottom of the screen. Is it possible with using pulltorefresh library? If not please help me to solve this problem.

Thanks in advance.

set OnScrollListener listener to your ListView . Based on number of items displayed, get new rows from web(Asynchronously) and add them to ArrayList(or whatever you are using to populate your list) and call notifyDataSetChanged() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM