Android Contacts - Update Note

前端 未结 1 926
Happy的楠姐
Happy的楠姐 2021-01-14 14:08

Im using the new\'ish API to insert/update contacts on my phone and I\'m using this method to updates them..

String selectArgs1 = Data.CONTACT_ID + \"=? AND          


        
1条回答
  •  轮回少年
    2021-01-14 14:47

    String selectArgs1 = Data.CONTACT_ID + "=? AND " + Data.MIMETYPE + "= ? ";
        String[] selectArgs2 = new String[]{contactId, "vnd.android.cursor.item/note"}; 
        operationList.add(ContentProviderOperation.newUpdate(Data.CONTENT_URI)
                .withSelection(selectArgs1, selectArgs2)
                .withValue(ContactsContract.CommonDataKinds.Note.NOTE, "hello@hi.com")
                .build());
    

    try this code...

    0 讨论(0)
提交回复
热议问题