Android Question How to add item at top of CustomListView

dragonguy

Active Member
Licensed User
Longtime User
i folow the topic https://www.b4x.com/android/forum/t...-and-loads-more-when-scroll-tot-bottom.35761/ successful to add item at bottom custom list view, but can't add item when scroll up to the top.

i have 1000 item (text and picture) in database and need to load into custom list view, when i load all into custom list view, my application start slow and lag when scroll.

so i decide first load the last 100 (900-1000) item into custom list view and when user scroll up to top and then load another 100 item(800-899) and so on.

please give me some advice, thanks.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
That example adds more items when the user scrolls to the bottom of the ScrollView.

There is another example which implements a "pull to refresh" feature: [class] Modified CustomListView with "Pull to refresh" feature

This is actually better than adding more and more images as you will run out of memory if you try to load too many.
 
Upvote 0
Top