I\'m implementing an endless listview by loading more items to the arraylist in the onScrollStateChanged(...) method. If I\'m implementing this scheme for fetching more than 1 m
You should use paging
and Load More
button as a footer of ListView
. For example:
url = http://your_full_url.php?page=1
let say you have 100 records in each page then very first time get all these 100 records of page 1
, display those on ListView
and cache
them. Now scroll down your ListView
and click on Load more button (Load More button should be set as footer of the ListView
).
When you click on Load More you will get next 100 records by calling
url = http://your_full_url.php?page=2
and so on for
url = http://your_full_url.php?page=3
,
url = http://your_full_url.php?page=4
etc...
each time you will cache those records so that in case of connection loss you could show records available in cache.