1.HashMap循環code
HashMap<Integer, Boolean> map = adapter.getChecked(); Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); Boolean val = (Boolean) entry.getValue(); if (val) { int position = (int)entry.getKey(); String fre = getFreByPosition(position); list.add(fre); } }