The AggregationException doc says: "This type only supports query and update. Neither insert nor delete are supported." You should be using cr.update(), not cr.insert()
On Wed, Jul 14, 2010 at 9:32 AM, Alvin <[email protected]> wrote: > yea but that takes a lot of time......and google should really have > some good explanation to the classes and functions they provide, > right? > > On Jul 13, 8:41 pm, Zsolt Vasvari <[email protected]> wrote: > > What you are trying to do is probably much more sophisticated than > > what most people are doing with Contacts, so I wouldn't expect much > > help. > > > > If I were in your situation, I'd download the source to the Contact > > app and the Contact provider and see what they are doing. Debugging > > this with the source code should be very doable. > > > > On Jul 14, 5:33 am, Alvin <[email protected]> wrote: > > > > > > > > > anyone helpe? > > > > > On Jul 13, 2:29 pm, Alvin <[email protected]> wrote: > > > > > > here's a few things i couldn't figure out and could find anyone else > > > > posting them in the discussion: > > > > 1. > > > > In the new API > > > > ContactsContract.AggregationExceptions table does not really work for > > > > me: when I try to insert a row into the table, it gives me this > error: > > > > > > 07-13 14:20:09.399: ERROR/XXXXX(3074): > > > > java.lang.UnsupportedOperationException: URI: > > > > content://com.android.contacts/aggregation_exceptions, calling > > > > user: ............ > > > > my code here: > > > > > > ContentValues values = new ContentValues(); > > > > values.put(AggregationExceptions.RAW_CONTACT_ID1, > > > > String.valueOf(oldRawContactId)); > > > > values.put(AggregationExceptions.RAW_CONTACT_ID2, > > > > String.valueOf(newRawContactId)); > > > > values.put(AggregationExceptions.TYPE, > > > > AggregationExceptions.TYPE_KEEP_TOGETHER); > > > > mContentResolver.insert(AggregationExceptions.CONTENT_URI, values); > > > > > > and I'm sure the two raw contact id exists. > > > > > > 2. > > > > in the old API: > > > > when I create a group in Contact book, the name of the group is not > > > > shown(or not shown correctly) > > > > here's the code: > > > > > > ContentValues values = new ContentValues(); > > > > values.put(Contacts.Groups.SHOULD_SYNC, 1); > > > > values.put(Contacts.Groups.SYSTEM_ID, mGroupID); > > > > values.put(Contacts.Groups.NAME, mGroupTitle); > > > > mContentResolver.insert(Contacts.Groups.CONTENT_URI, values); > > > > > > 3. > > > > in the old API: > > > > when I insert a custom IM contact method for a contact, the data is > > > > inserted and shown correctly, but user cannot edit the contact using > > > > the default contact app any more. If I remove the contact method, > user > > > > can edit the contact again. > > > > here's the code for inserting the contact method: > > > > > > ContentValues values = new ContentValues(); > > > > values.put(ContactMethods.PERSON_ID, newContactId); > > > > values.put(ContactMethods.KIND, Contacts.KIND_IM); > > > > values.put(ContactMethods.TYPE, ContactMethods.TYPE_CUSTOM); > > > > values.put(ContactMethods.AUX_DATA, > > > > ContactMethods.encodeCustomImProtocol(MYIM_PROTOCOL)); > > > > values.put(ContactMethods.DATA, buddyId); > > > > values.put(ContactMethods.ISPRIMARY, 0); > > > > values.put(ContactMethods.LABEL, IM_LABEL); > > > > > > mContentResolver.insert(ContactMethods.CONTENT_URI, values);- Hide > quoted text - > > > > > - Show quoted text - > > -- > 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

