I want to do some stuff. I wanna do lazy loading in ListView
. My ListView
contain more than 10,000 data & only in TextView
. so i can't load all that data in first time when i launch list activity. it's not efficient so i can load first 20 or 30 items in list. further the rows of the ListView
are loaded when I scroll over them. so when i reach at last index of ListView
on last index, i will put progressbar n it will note that the new data are loaded, so at that time new data will be load with last + 1 index. How can i do this?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Add an onScrollListener to the ListView. When the user scrolls, check if the ListView is nearing its end. If yes, then fetch more data. As an example :
Activity :
You can find the complete implementation at this link
You can achieve this by using endless Adapter implementation. This exactly does what you want. You can also restrict the number of rows to be refreshed per scroll. Here is a link to it.,
Android: Implementing progressbar and "loading..." for Endless List like Android Market
https://github.com/commonsguy/cwac-endless
To use it, you extend EndlessAdapter to provide details about how to handle the endlessness. Specifically, you need to be able to provide a row View, independent from any of the rows in your actual adapter, that will serve as a placeholder while you, in another method, load in the actual data to your main adapter. Then, with a little help from you, it seamlessly transitions in the new data.
Make your lists scroll faster:-
getView
of your adapter.//put in calling function :
and inner class: