You need to override the toString()
method of your custom type, which you started to do, but then just called the super which negates the purpose of overriding it in the first place.
Make the toString()
return what you want the arrayadapter to display in the ListView
i.e.
@Override
public String toString(){
return title + address + distance;
}
Of course, this is just an example, you can implement it to fit your needs.
Also, the reason is because ArrayAdapter<T>
by default calls the toString()
method of the custom type to populate the TextView
in the current row of the ListView
. If you need the list to show something special above what you can put together in the overrided toString method you will have to create a custom adapter.