views:

91

answers:

1

HI,

I would like to know if it is possible to display Arraylist of object's value in setListadapter or SimpleAdapter for listview?

String ArrayList works fine, I am just trying my luck with Object ArrayList

ArrayList<userinfo> list = new ArrayList<userinfo>();


setListAdapter(new ArrayAdapter<userinfo>(this, R.layout.messages, list)); // list.???


userinfo class consist of all the getters and setters.

String ArrayList(Working Version) @ http://developer.android.com/resources/tutorials/views/hello-listview.html

A: 

Simplest solution is to implement userinfo.toString() method - then ArrayAdapter will automatically use this method to get string values from your objects. If you don't want to do that this way, you could overwrite ArrayAdapter.getView() method and create View objects manually.

Brutall
Thanks! <3 xoxoxoxoxoxo
Houston we have a problem