How to update contact number using Android -
I'm learning Android I'm trying to upgrade the contact number programmatically. Anybody can help me please how can I do this.
My attempt is:
string lNumber = pCur.getString (pCur.getColumnIndex (ContactsContract.CommonDataKinds.Phone.NUMBER)); Material values = new material value (); Uri lPhoneUri = Uri. Withdrawal (ContactContact.com.comDayDayDind.Phone Contribution, ContactCactrect.comCommentIndex.php NUMBER); Values.put (ContactContact.com.comDayDinds.on., "45323333")); GetContentResover () Update (lphonehone, values, ContactsContract.CommonDataKinds.Phone.NUMBER + "=?", New string [] {lNumber});
I think you are too much. The following contact's work uses the new API to update the phone number, assuming that the contact already has a work phone number in the
public zeros update dialog (string contact id, string New Number, Activity Act) RemoteActionation, Operation Applications Exception {// ASERT: @ Contact Id Alray has a work phone number in ArrayList & lt; ContentProviderOperation & gt; Ops = new arreelist & lt; Content provider operation & gt; (); String selectphone = data. CONTACT_ID + "=? And" + data. MIMETYPE + "= '" + Phone CONTENT_ITEM_TYPE + "'" + "and" + Phone Yip + "="? "; String [] phoneArgs = new string [] {contactId, String.valueOf (phone.TYPE_WORK)}; Ops.add (ContentProviderOperation.newUpdate (Data.CONTENT_URI) .with selection (select phone, phone order) .withValue (Phone Number, new number). Build ()); Act.getContentResolver (). ApplyBatch (ContactsContract.AUTHORITY, Ops);}
Comments
Post a Comment