public class Adapter extends BaseAdapter {
private ArrayList<Line> lines;
private List<String> data_list;
private String[] checkListName;
private List<Integer> list;
private Worker worker;
// 存储以名值对。存放Spinner的Prompt和用户选中的值
private Map<String, Integer> allValues;
public Adapter(ArrayList<Line> mLines, Worker worker,List<Integer> list) {
this.list=list;
this.lines = mLines;
this.worker = worker;
data_list = new ArrayList<String>();
for (int i = 0; i < worker.getData().size() + 1; i++) {
if (i == 0) {
data_list.add("");
} else {
data_list.add(worker.getData().get(i-1).getRealName());
}
}
checkListName = new String[worker.getData().size()];
for (int j = 0; j < worker.getData().size(); j++) {
aCache.put("工人" + j, "0");
checkListName[j] = "工人" + j;
}
allValues = new HashMap<String, Integer>();
putAllValues();
}
private void putAllValues() {
for (String str : checkListName) {
allValues.put(str, 0);
}
}
public void setAllValues(Map<String, Integer> allValues) {
this.allValues = allValues;
}
ListView里面嵌套spinner和editext
最新推荐文章于 2024-06-17 09:03:13 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)