我们常用的是hashmap
这里我们用到hashmap+Arraylist
首先:
HashMap result = new HashMap();
ArrayList context = new ArrayList();
result.put(“context“,context);
下面是内容:
for(int i=0;i<3;i++){
HashMap row = new HashMap();
row.put(“count”,“第”+i+“个”);
context.add(row);
}
这样就把所有的内容都加到result里了。
如果你打印result,会看到:{ [{“count”=“第1个”}][{“count”=“第2个”}]
[{“count”=“第3个”}]}
这里,使用coustomtag,如果在一行的显示中写同样的名字“count“便可以看到列表了。