这个问题在这里已有答案:
现在:
我想要:
码:
String[] contact = new String[contact_phoneList.size()];
for (int i = 0; i < contact_phoneList.size(); i++) {
contact [i] = contact_phoneList.get(i);
}
使用HashSet删除重复值:
HashSet hs = new HashSet();
hs.addAll(contact_phoneList); // name of contact_phoneList from which you want to remove duplicates
contact_phoneList.clear();
contact_phoneList.addAll(hs);
不需要for
循环