ContactsManager.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:Linphone4Android 作者:
public void deleteMultipleContactsAtOnce(List<String> ids) {
    String select = Data.CONTACT_ID + " = ?";
    ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();

    for (String id : ids) {
        String[] args = new String[] { id };
        ops.add(ContentProviderOperation.newDelete(ContactsContract.RawContacts.CONTENT_URI).withSelection(select, args).build());
    }

    ContentResolver cr = ContactsManager.getInstance().getContentResolver();
    try {
        cr.applyBatch(ContactsContract.AUTHORITY, ops);
    } catch (Exception e) {
        Log.e(e);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号