Update. Don't insert.  Here's a quote from the doc: "This type only supports
query and update. Neither insert nor delete are supported."  Update even
though this row does not exist - the provider will know what to do.

On Mon, Oct 18, 2010 at 2:38 AM, Goran Krstevski <[email protected]>wrote:

> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
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

Reply via email to