} remark.company = companyname; Log.i(TAG, "company:" + companyname); }while(c.moveToNext()); } c.close(); c = null; // 家庭住址信息 projection = new String[] { Data.DATA7, Data.DATA10, Data.DATA4, Data.CONTACT_ID }; c = getContentResolver().query( Data.CONTENT_URI, projection, Data.MIMETYPE + "= and " + StructuredPostal.TYPE + "= " , new String[]{StructuredPostal.CONTENT_ITEM_TYPE, StructuredPostal.TYPE_HOME+""}, Data.CONTACT_ID + " asc"); if(c.moveToFirst()){ int data4 = c.getColumnIndex(Data.DATA4); int data7 = c.getColumnIndex(Data.DATA7); int data10 = c.getColumnIndex(Data.DATA10); int id = c.getColumnIndex(Data.CONTACT_ID); do{ String sData4 = c.getString(data4); String sData7 = c.getString(data7); String sData10 = c.getString(data10); String cid = c.getString(id); StringBuilder sb = new StringBuilder(); // 依次为国家、城市、街道 if(!TextUtils.isEmpty(sData10)) sb.append(sData10).append(";"); if(!TextUtils.isEmpty(sData7)) sb.append(sData7).append(";"); if(!TextUtils.isEmpty(sData4)) sb.append(sData4); Item remark = list.get(cid); if(remark == null){ remark = new Item(); list.put(cid, remark); } remark.address = sb.toString(); Log.i(TAG, "address:" + remark.address); }while(c.moveToNext()); } c.close(); // 家庭号码 projection = new String[] { Phone.NUMBER, Phone.CONTACT_ID}; c = getContentResolver().query( Phone.CONTENT_URI, projection, Phone.TYPE + "= ", new String[]{Phone.TYPE_HOME + ""}, Phone.CONTACT_ID + " asc"); if(c.moveToFirst()){ int num = c.getColumnIndex(Phone.NUMBER); int id = c.getColumnIndex(Phone.CONTACT_ID); do{ String cid = c.getString(id); String phone = c.getString(num); Item remark = list.get(cid); if(remark == null){ remark = new Item(); list.put(cid, remark); } remark.fnumber = phone; Log.i(TAG, "family Phone:" + phone); }while(c.moveToNext()); } c.close(); // 备注 projection = new String[] { Data.DATA1, Data.CONTACT_ID}; c = getContentResolver().query( Data.CONTENT_URI, projection, Data.MIMETYPE + "= ", new String[]{Note.CONTENT_ITEM_TYPE}, Data.CONTACT_ID + " asc"); if(c.moveToFirst()){ int data1 = c.getColumnIndex(Data.DATA1); int id = c.getColumnIndex(Data.CONTACT_ID); do{ String cid = c.getString(id); String note = c.getString(data1); Item remark = list.get(cid); if(remark == null){ remark = new Item(); list.put(cid, remark); } if(!TextUtils.isEmpty(note)){ remark.note = note; Log.i(TAG, "note:" + note); } }while(c.moveToNext()); } c.close(); // 对应的分组 ArrayList gid = new ArrayList(); // group Id ArrayList gname = new ArrayList(); // group name c = getContentResolver().query(Groups.CONTENT_URI, new String[]{Groups.TITLE, Groups._ID}, null, null, null); if(c.m |