String[] projection = new String[] {
RawContacts.CONTACT_ID, // the contact id column
RawContacts.DELETED // column if this contact is deleted
};
Cursor rawContacts = mCtx.getContentResolver().query(
RawContacts.CONTENT_URI, // the uri for raw contact provider
projection,null,null,null);
int contactIdColumnIndex = rawContacts.getColumnIndex(RawContacts.CONTACT_ID);
int deletedColumnIndex = rawContacts.getColumnIndex(RawContacts.DELETED);
if(rawContacts.moveToFirst()) {
while(!rawContacts.isAfterLast()) {
int contactId = rawContacts.getInt(contactIdColumnIndex);
boolean deleted = (rawContacts.getInt(deletedColumnIndex) == 1);
if(!deleted) {
ArrayList<String> strArr = getAllPhoneNumbers(contactId);
if(strArr != null && !strArr.isEmpty()){
.......................................
}
}
콘택트 리스트를 구하기위해 위코드를 실행하면
멤버가 중복되는경우가 생깁니다
특정인물의 정보가 두번씩 검색되는겁니다
왜 그런건지 이유를 알고싶습니다
해결책은 어떤지....
조언부탁합니다
rawContacts.moveToNext(); // move to the next entry
}
}