In my opinion the trick is to use a real listview. Listview will manage all the recycling process and will help you to avoid the out of memory errors.
The fast and short theory behind listview is this:
- If there are X visible items in the listview, then there are only X (or X+1) items in memory (the listview can contain thousand of items, but there will only be an X number of visible items, and X being a small number)
- Lets say you have 10 visible items, and hundred of items in the listview. If the visible items are 1 to 10, and then you scroll a little bit to see items from 2 to 11, then the item number 1 will no longer be visible, then the listview will recycle the content of that items to be used as the number 11. So you can scroll as long as you want, and there will always be just 10 items in memory.
There are several option that you can find in the forum for listviews.
-
The native one, which I think will not suit your needs, because you need some sort of custom rows (maybe 3 or 4 imageView in each row?)
-
Create your own listview, this is a long path, you will need to know Java and understand all the logic behind the listviews.
-
UltimateListView, the magic one, this will let you create the layout of a row using the B4A designer, but is chargeable.