I have about 700 items to display in the grid view.
On a Samsung Galaxy Tab 10.1 this is not a problem: it has enough memory.
On a HTC Explorer the heap is overflown.
So I want to load data dynamically regarding current scroll position (N rows for screen + 5 rows as a tail). And I want to show a scrollbar which represents the position in total rows. But I don’t want to draw items that I don’t see.
In other words, I want to create something similar to UITableView in iOS. How can I do this?
Android
Adapterworks in a similar way to iOSUITableViewDataSource. You need to callon your
GridViewand then that Adapter will get call backs like:It’s important that you reuse
convertViewthe same way you dequeue aUITableViewCellinIf you do all that correctly, it will never try to load all the views at once, but only the ones currently displayed and you shouldn’t have memory problems any more.