通讯录加入arraylist>demo

private ArrayList<HashMap<String, Object>> getdata() {
ArrayList<HashMap<String, Object>> cl = new ArrayList<HashMap<String, Object>>();
contactFriends = getContacts();


while (contactFriends.moveToNext()) {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("id", contactFriends.getString(contactFriends
.getColumnIndex(Contacts._ID)));
map.put("name", contactFriends.getString(contactFriends
.getColumnIndex(Contacts.DISPLAY_NAME)));
cl.add(map);
}


return cl;
}

你可能感兴趣的:(object,String,HashMap,通讯)