I’m trying to display information about an object, concretely a customer. I mean name, last name, telephone number, adress, …. that is the result by a query on my database.
I want to display this on a ListView, so better if my activity inherit of a ListActivity because ListView is self-contained by default.
I do the next: I have a class called Customer that saves all information by the query (Cursor) that only return one record(customer) and I don’t know how to pass this object ,I don’t find the most appropriate adapter.
Can I do this by this way or I must convert this object into an ArrayList that contains all information and, in fact, use ArrayAdapter for my adapter?
Anyone knows how to do this??
Thanks.
Once you have your cursor queried you should do something like this
check here the documentation for
SimpleCursorAdapter.If you need to do something more complicated with your views you should implement your own custom Cursor adapter: