Guest User

Untitled

a guest
Aug 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. Combine two existing contact by AggregationExceptions
  2. ArrayList<ContentProviderOperation> ops0 = new ArrayList<ContentProviderOperation>();
  3. ops0.add(ContentProviderOperation.newUpdate(ContactsContract.AggregationExceptions.CONTENT_URI)
  4. .withValue(ContactsContract.AggregationExceptions.RAW_CONTACT_ID1,ID_main)
  5. .withValue(ContactsContract.AggregationExceptions.RAW_CONTACT_ID2,ID_other)
  6. .withValue(ContactsContract.AggregationExceptions.TYPE,ContactsContract.AggregationExceptions.TYPE_KEEP_TOGETHER).build());
  7. try {
  8. getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops0);
  9. } catch (Exception e) {
  10. // TODO Auto-generated catch block
  11. e.printStackTrace();
  12. }
  13.  
  14. .withValue(ContactsContract.AggregationExceptions.RAW_CONTACT_ID1,ID_main)
  15. .withValue(ContactsContract.AggregationExceptions.RAW_CONTACT_ID2,ID_other)
  16.  
  17. .withValue(ContactsContract.AggregationExceptions.RAW_CONTACT_ID1,ID_other)
  18. .withValue(ContactsContract.AggregationExceptions.RAW_CONTACT_ID2,ID_main)
Add Comment
Please, Sign In to add comment