이 코드는 주소록에 저장된 연락처의 이름을 다른 이름으로
변경하는 코드입니다.
즉, 이름을 이용 해 다른이름으로 바꾸는 것 인데요.
저는 이름을 이용해 다른이름으로 바꾸지 않고
번호를 이용해 해당하는 이름을 다른이름으로 바꾸고 싶습니다.
알고 계시는 고수분들 부탁드립니다..ㅠㅠ
if (c.getCount() > 0) {
while (c.moveToNext()) {
String id = c.getString(c.getColumnIndex(ContactsContract.Contacts._ID));
String i = "sop";
if (findSamePhoneId(cr, id, i) == true) {
String where = ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME + " = '" + i + "'" + " AND "+
ContactsContract.Data.RAW_CONTACT_ID + " = '" + id +
"' AND " + ContactsContract.Data.MIMETYPE + " = '" +
ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE + "'" ;
String new_number = "slk";
ContentValues values = new ContentValues();
values.put(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, new_number);
Log.e("eeeeeeeeeeeee", where);
int count = cr.update(ContactsContract.Data.CONTENT_URI, values, where, null);
}
}
}