Android Question Paginating / Load More feauture in CustomListView

Mashiane

Expert
Licensed User
Longtime User
Hi

I have an app that uses a MySQL db and my app reads records from the database located remotely and returns a json string for all selected records. The records could be 1000 or more and these get loaded to a customlistview that also reads the images from the server, these images keep on changing.

What I would like to implement is a 'Load More' or Paginated feature in my CustomListview, perhaps load the first 10 records from the json string return and then load more from the last position that was loaded etc.

e.g. 1. Load first 10 records, on 'Load More' click then
2. Load records 11 - 20 etc etc.

How can I achieve this? Remember, the records have links to images, which means I have to do a getbitmap method of http at some stage.
 

sorex

Expert
Licensed User
Longtime User
You'll lose less time when pulling in all 1000 at once and then apply the paging on that instead of fetching 10 records each time via http.

Just increase a page counter and multiply it with 10 to know from which record you want to display data from.
 
Upvote 0
Top