Guest User

Untitled

a guest
May 27th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. batch = new ArrayList<ContentProviderOperation>();
  2.  
  3. for ( User contact : new User[] { alice, bob, carol } ) {
  4.  
  5. builder = ContentProviderOperation.newInsert(RawContacts.CONTENT_URI);
  6. batch.add(builder.build());
  7.  
  8. builder = ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI);
  9. builder.withValueBackReference(Email.RAW_CONTACT_ID, 0);
  10. batch.add(builder.build());
  11.  
  12. builder = ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI);
  13. builder.withValueBackReference(Phone.RAW_CONTACT_ID, 0);
  14. batch.add(builder.build());
  15.  
  16. }
Add Comment
Please, Sign In to add comment