ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
ops.clear();
ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
.withSelection(Data._ID + "=?", new String[]{String.valueOf(id)})
.withValue(Email.DATA, "somebody1@android.com")
.build());
try
{
context.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
}
The logs don't show me anything. But the email is not updated. Does anyone know why?
The ops converted to string is as follows:
[mType: 2, mUri: content://com.android.contacts/data, mSelection: _id=?, mExpectedCount: null, mYieldAllowed: false, mValues: data1=somebody1@android.com, mValuesBackReferences: null, mSelectionArgsBackReferences: null]