I am developing an android app that adds fields to some contact that is in the android's data base. Through the app I can delete fields, too. I tested the application on some devices and the fields I add or delete with the application are added/deleted from the contact's information and from the device's database. But when I tested it on android 4.3 (Samsung Galaxy S4) it is not working(only for the adding, deleting and updating fields works). I add field in that way :
ContentValues values = new ContentValues();
values.put(Data.RAW_CONTACT_ID, contactId);
values.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
values.put(Phone.NUMBER, "12-45-4-33");
values.put(Phone.LABEL, "assistance");
Uri dataUri = getContentResolver().insert(Data.CONTENT_URI,values);
I even tryed to add field with ContentProviderOperation in that way:
ArrayList<ContentProviderOperation> values =
new ArrayList<ContentProviderOperation>();
values.add(ContentProviderOperation.newInsert(Data.CONTENT_URI)
.withValue(Data.RAW_CONTACT_ID, contactId)
.withValue(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE)
.withValue(Phone.NUMBER, "12-45-4-33")
.withValue(Phone.LABEL, "assistance")
.build());
getContentResolver().applyBatch(ContactsContract.AUTHORITY, values);
Thank you.