What's the _id here? It should be the data row id, not the contact id. Also, you shouldn't specify the mime type in an update statement - it is not updatable.
Cheers, Dmitri On Apr 19, 2010 2:44 AM, "Timo Prill" <[email protected]> wrote: > hi all, > > i got a problem updating a contact's details. > i use the following code to update the contact name: > "operations" is a ArrayList of ContentProviderOperation. > > > operations.add(ContentProviderOperation.newUpdate( > ContactsContract.Data.CONTENT_URI) > .withSelection(Data._ID + "=?", new String[]{id}) > > .withValue(Data.MIMETYPE,StructuredName.CONTENT_ITEM_TYPE) > .withValue(StructuredName.GIVEN_NAME, firstName) > .withValue(StructuredName.FAMILY_NAME, lastName) > .build()); > > contentResolver.applyBatch(ContactsContract.AUTHORITY, operations); > > > but after this query, the contact name is not updated.. (at least the > name did not change in the phone's addressbook) > i cant figure out why...what am i doing wrong? must be a simple thing i > am missing.. > > thanks in advance > timo > > > -- > 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

