title: How to aggregate contact data, when trying to add new contact?
body: <p>I'm building an app where you can download the address of any point of interest to your personal contacts.</p>
  
  <p>I'm using this code, to add the contact. Found it here at Stackoverflow. ;)</p>
  
  <pre><code>ops = new ArrayList&lt;ContentProviderOperation&gt;();
              ops.add(ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI)
     .withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, null)
     .withValue(ContactsContract.RawContacts.ACCOUNT_NAME, null).build());
  
  //------------------------------------------------------ Names
  if (title != null) {
     ops.add(ContentProviderOperation
          .newInsert(ContactsContract.Data.CONTENT_URI)
           .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
           .withValue(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
           .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, title).build());
  }
  
  //------------------------------------------------------ Work Numbers
  if (phone != null) {
     ops.add(ContentProviderOperation
         .newInsert(ContactsContract.Data.CONTENT_URI)
         .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
         .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)
         .withValue(ContactsContract.CommonDataKinds.Phone.NUMBER, phone)
         .withValue(ContactsContract.CommonDataKinds.Phone.TYPE, ContactsContract.CommonDataKinds.Phone.TYPE_COMPANY_MAIN).build());
  }
  
  //------------------------------------------------------ Address
  ops.add(ContentProviderOperation
      .newInsert(ContactsContract.Data.CONTENT_URI)
      .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, 0)
      .withValue(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE)
      .withValue(ContactsContract.CommonDataKinds.StructuredPostal.TYPE, ContactsContract.CommonDataKinds.StructuredPostal.TYPE_WORK)
      .withValue(ContactsContract.CommonDataKinds.StructuredPostal.CITY, city)
      .withValue(ContactsContract.CommonDataKinds.StructuredPostal.POSTCODE, zip)
      .withValue(ContactsContract.CommonDataKinds.StructuredPostal.STREET, street).build());
  
  getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
  </code></pre>
  
  <p>This works fine, as long as this contact not exists. Else, adding an entry will add other duplicate entries, even if all the data are exactly the same. When reading this <a href="http://developer.android.com/resources/articles/contacts.html" rel="nofollow">article</a>, especially the part about aggregation, I thought Android could handle that automatically. But obviously, it doesn't for me.</p>
  
  <p>Is there an easy way to force Android to aggregate the new entry with existing entries, if they correspond?</p>