Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- batch = new ArrayList<ContentProviderOperation>();
- +int currentContactIndex = 0;
- for ( User contact : new User[] { alice, bob, carol } ) {
- builder = ContentProviderOperation.newInsert(RawContacts.CONTENT_URI);
- batch.add(builder.build());
- builder = ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI);
- - builder.withValueBackReference(Email.RAW_CONTACT_ID, 0);
- + builder.withValueBackReference(Email.RAW_CONTACT_ID, currentContactIndex);
- batch.add(builder.build());
- builder = ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI);
- - builder.withValueBackReference(Phone.RAW_CONTACT_ID, 0);
- + builder.withValueBackReference(Phone.RAW_CONTACT_ID, currentContactIndex);
- batch.add(builder.build());
- + currentContactIndex += 3;
- }
Add Comment
Please, Sign In to add comment