How to display List<> using ListView?

Posted by eriX on Stack Overflow See other posts from Stack Overflow or by eriX
Published on 2010-05-25T17:26:25Z Indexed on 2010/05/25 17:51 UTC
Read the original article Hit count: 161

Filed under:
|
|

When I use ListView to display a array of my object, I can use the following code:

MyObject[] myObject;
...  
ArrayAdapter<MyObject> itemList = new ArrayAdapter<MyObject>(this, R.layout.list, myObject);   
setListAdapter(itemList);

In case that the input is a list:

List<MyObject> myobject;

How can I assign it to ListAdapter? Please advise, Thx!

© Stack Overflow or respective owner

Related posts about android

Related posts about list