I need to implement an Android viewer to display a list of results (from a real estate site web query), which I have in a list property (
private List<Estate> estatesList;
)
For each item I have one image, one description, one phone number (and some more text fields).
I would like my app to display each result, one per page, and to display the next (or previous) one on a “swipe” (or “fling”?) gesture from user.
The question is: which is the right approach? Should I use a “ListActivity”? If so, how do I bind it to my objects list? Or should I better use a ListView?
A
ListActivityis a special kind ofActivitythat contains aListView. Basically, aListActivitydoes just provide an easier API to build an Activity around aListView. Nevertheless, this class is a bit useless and tends to be less interesting on the long run. You should better use an normalActivity(I mean build your own class that extendsActivity) and add aListViewin it.You should learn how to use a
ListAdapterto feed yourListViewwith some data (the list model in MVC). You got two main alternatives : using a memory adapter, or use a CursorAdapter that will pick data directly from a database.There are many tutorials on the web to start learning
ListViews. This could be a good one, among many many others.Regards,
steff