I’ve got a class called PhoneContact with 3 properties:
Title, Description and PhoneNumber
If I have a collection of these, how would I go about binding these to a ListView containing a TextView for each property?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Extend
ArrayAdapter, overriding thegetView(int, View, ViewGroup).To hook up your custom adapter, I’ll assume your
ActivityextendsListActivity. In one of the lifecycle methods (such asonCreate(),onResume(), oronStart()), callsetListAdapter(myCustomAdapter).This article shows how to do it: Android Series: Custom ListView items and adapters.