I'm creating an android book that use data from database(sqlite) and has six season. my data is about 1MB and for loading data on listview is slow.I wanna to put a dynamic listview for my project that load 10 item on listview with scrolling each time. please help me
2
-
2what have you done so far for this in code?Ulf Gjerdingen– Ulf Gjerdingen2016-07-29 07:56:50 +00:00Commented Jul 29, 2016 at 7:56
-
If you want to load 10 items each time, you just need to get 10 data from database and then notify. I think it's mostly depends on your app's logic.L. Swifter– L. Swifter2016-07-29 07:59:58 +00:00Commented Jul 29, 2016 at 7:59
Add a comment
|
1 Answer
ListView actually keep in memory items only visible for users - check it for better understanding - http://android.amberfog.com/?p=296.
I think you are talking about lazy loading data from sqlite, so just fetch next 20 (or whatever) items when user scrolled to last item.
I recommend you to switch to RecyclerView. Please check that article for implementation of endless scrolling with RecyclerView.
1 Comment
Divers
@mohsen1993 I think I cover both cases in my answer. If you still have question, feel free to ask. If no - close your question with marking that answer as a right one.