我想用一些数据填写我ListView
并使用SimpleAdapter
. 但我认为SimpleAdapter
仅适用于List<HashMap<String, String>>
并且我 List<Object>
喜欢以下代码:
我能做些什么?有什么办法吗?
List<DSarchive> programs = ...;
String[] from = new String[] {"name", "time", "day", "month"};
int[] to = new int[] { R.id.text1, R.id.text2, R.id.text3, R.id.text4};
SimpleAdapter adapter = new SimpleAdapter(getActivity(), programs, R.layout.my_list_row, from, to);
// ^ how can I use this "programs" List???
lv.setAdapter(adapter);
我想List
在MyObject
.
我的对象类:
public class MyObject{
public ArrayList<String> links;
public String name;
public List<HashMap<String, String>> adapter;
.
.
.
}