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?
I want to do some stuff. I wanna do lazy loading in ListView .
Share
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.