samedi 5 juillet 2014

How to update FAMILY_NAME in Android contact


Vote count:

0




How can i update the Familyname in the contact programatically



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?



asked 12 secs ago






Aucun commentaire:

Enregistrer un commentaire