Android:如何在ContentProviderOperation中更新多个字段,例如电子邮件,phoneNumber?

时间:2018-09-24 18:37:26

标签: android

我已经看到了一个简单的更新:

    ArrayList contentProviderOperations = new ArrayList();
    String selection = ContactsContract.Data.RAW_CONTACT_ID + "=?";

    contentProviderOperations.add(
        ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
            .withSelection(selection, new String[] {0})
            .withValue(CommonDataKinds.Phone.NUMBER, "88888888888").build());
    try {
        getApplicationContext().getContentResolver().applyBatch(ContactsContract.AUTHORITY, contentProviderOperations);
    } catch (Exception e) {
        e.printStackTrace();
    }

您是否有一些文档,示例,操作方法的想法?

0 个答案:

没有答案