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);
}
日志没有显示任何内容。但是邮件没有更新。有谁知道为什么?
转换为字符串的操作如下:
[mType: 2, mUri: content://com.android.contacts/data, mSelection: _id=?, mExpectedCount: null, mYieldAllowed: false, mValues: data1=somebody1@android.com, mValuesBackReferences: null, mSelectionArgsBackReferences: null]