|
@@ -166,12 +166,14 @@ public class ContactHelper {
|
|
|
Integer contact_id2 = isPhoneNumbExist(context, phoneNumber);
|
|
|
Log.i("ContactId", "setContact: " + contact_id2 + "");
|
|
|
if (contact_id != null && contact_id > 0) {
|
|
|
+ deleteContact(context,name);
|
|
|
if (!(contact_id2 != null && contact_id2 > 0 && contact_id.equals(contact_id2))) { //非 通讯录中原有号码和姓名匹配的情况
|
|
|
if (contact_id2 != null && contact_id2 > 0) { //号码已经存在了
|
|
|
deleteContact(context, contact_id2); //删除号码
|
|
|
}
|
|
|
- updateContact(context, contact_id, phoneNumber); //更新通讯录
|
|
|
+// updateContact(context, contact_id, phoneNumber); //更新通讯录
|
|
|
}//通讯录姓名和号码没有变化,不用操作
|
|
|
+ insertContact(context, name, phoneNumber);
|
|
|
} else { //这个名字不存在通讯录中
|
|
|
insertContact(context, name, phoneNumber);
|
|
|
if(contact_id2!=null&&contact_id2>0){ //电话号码确在通讯录中
|