I have class Person
class person{
int ID ;
sting FirstName ;
string Last Name ;
String Telephone ;
}
and I have ArrayList
Make your ArrayAdapter
to use the type person
and not String
(also, just pass the ArrayList
instead of an array) like this:
ArrayAdapter modeAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, android.R.id.text1, theArrayList);
and then override the person
's class toString
method:
class person {
int ID;
String FirstName;
String LastName;
String Telephone;
@Override
public String toString() {
return "Whatever " + FirstName + " and Whatever " + LastName;
}
}