I read in ContactsContract API that applications can manual control
contacts aggregation by adding a row to the
ContactsContract.AggregationExceptions table. I try this code:
...
ArrayList<ContentProviderOperation> ops = new
ArrayList<ContentProviderOperation>();
ops.add(ContentProviderOperation.newInsert(ContactsContract.AggregationExceptions.CONTENT_URI)
.withValue(AggregationExceptions.TYPE,
AggregationExceptions.TYPE_KEEP_TOGETHER)
.withValue(AggregationExceptions.RAW_CONTACT_ID1,
masterContactId)
.withValue(AggregationExceptions.RAW_CONTACT_ID2,
contactId).build());
getApplicationContext().getContentResolver().applyBatch(ContactsContract.AUTHORITY,
ops);
...
but this Exception was thrown:
java.lang.UnsupportedOperationException: Unknown uri:
content://com.android.contacts/aggregation_exceptions
at
com.android.providers.contacts.LegacyApiSupport.insert(LegacyApiSupport.java:
832)
Any suggestion for manual contact aggregation that works?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en