Android 1.5(Ophone 1.5)public void update(Person person){
String Name = person.getName();
String Mobile = person.getMobile();
String TelPhone = person.getTelPhone();
String Email = person.getEmail();
Log.d("Lancy", Name+"'s Attributes: "+Mobile+" "+TelPhone+" "+Email);
String id = getID(Name);
Log.d("Lancy", "getID: "+id);
try {
mContentValues.clear();
mContentValues.put(Contacts.Phones.TYPE, Contacts.Phones.TYPE_MOBILE);
mContentValues.put(Contacts.Phones.NUMBER, Mobile);
try {
mContentResolver.update(Contacts.Phones.CONTENT_URI, mContentValues, Contacts.Phones.PERSON_ID+"="+id, null);
} catch (Exception e) {
Log.d("Lancy", "Point 2: "+e.toString());
}
mContentValues.clear();
mContentValues.put(Contacts.Phones.TYPE, Contacts.Phones.TYPE_HOME);
mContentValues.put(Contacts.Phones.NUMBER, TelPhone);
try {
mContentResolver.update(Contacts.Phones.CONTENT_URI, mContentValues, Contacts.Phones.PERSON_ID+"="+id, null);
} catch (Exception e) {
Log.d("Lancy", "Point 3: "+e.toString());
}
mContentValues.clear();
mContentValues.put(Contacts.ContactMethods.KIND , Contacts.KIND_EMAIL);
mContentValues.put(Contacts.ContactMethods.DATA, Email);
try {
mContentResolver.update(Contacts.ContactMethods.CONTENT_URI, mContentValues, Contacts.ContactMethods.PERSON_ID+"="+id, null);
} catch (Exception e) {
Log.d("Lancy", "Point 4: "+e.toString());
}
} catch (Exception e) {
Log.d("Lancy", e.toString());
}
String Name = person.getName();
String Mobile = person.getMobile();
String TelPhone = person.getTelPhone();
String Email = person.getEmail();
Log.d("Lancy", Name+"'s Attributes: "+Mobile+" "+TelPhone+" "+Email);
String id = getID(Name);
Log.d("Lancy", "getID: "+id);
try {
mContentValues.clear();
mContentValues.put(Contacts.Phones.TYPE, Contacts.Phones.TYPE_MOBILE);
mContentValues.put(Contacts.Phones.NUMBER, Mobile);
try {
mContentResolver.update(Contacts.Phones.CONTENT_URI, mContentValues, Contacts.Phones.PERSON_ID+"="+id, null);
} catch (Exception e) {
Log.d("Lancy", "Point 2: "+e.toString());
}
mContentValues.clear();
mContentValues.put(Contacts.Phones.TYPE, Contacts.Phones.TYPE_HOME);
mContentValues.put(Contacts.Phones.NUMBER, TelPhone);
try {
mContentResolver.update(Contacts.Phones.CONTENT_URI, mContentValues, Contacts.Phones.PERSON_ID+"="+id, null);
} catch (Exception e) {
Log.d("Lancy", "Point 3: "+e.toString());
}
mContentValues.clear();
mContentValues.put(Contacts.ContactMethods.KIND , Contacts.KIND_EMAIL);
mContentValues.put(Contacts.ContactMethods.DATA, Email);
try {
mContentResolver.update(Contacts.ContactMethods.CONTENT_URI, mContentValues, Contacts.ContactMethods.PERSON_ID+"="+id, null);
} catch (Exception e) {
Log.d("Lancy", "Point 4: "+e.toString());
}
} catch (Exception e) {
Log.d("Lancy", e.toString());
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货