How to update FAMILY_NAME in Android contact

Saturday, July 5, 2014

How can i update the Familyname in the contact programatically, I used the following code



ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
ops.add(ContentProviderOperation.newUpdate(Data.CONTENT_URI)
.withSelection(Data.RAW_CONTACT_ID + " = ?" + " AND "+ ContactsContract.Data.MIMETYPE + " = ?",
new String[] {String.valueOf(mRawContactId), StructuredName.CONTENT_ITEM_TYPE })
.withValue(StructuredName.FAMILY_NAME,"Krishnan").build());
getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);


But the contact not updating when i Run this code How can I solve this?







http://ift.tt/1xuWrl2