Wednesday, January 12, 2011

[android-developers] Re: (Unknown) contact showing up after a modify

Sorry all, there was a newInsert() as part of the larger function that
was causing this problem.

Simon Mac Donald
http://hi.im/simonmacdonald

On Wed, Jan 12, 2011 at 5:28 PM, Simon MacDonald
<simon.macdonald@gmail.com> wrote:
> Hi all,
>
> I have a weird issue on an Android 2.2 device.  I have an existing
> contact and I do a modify operation on it via:
>
> ContentProviderOperation.Builder builder =
> ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
>        .withSelection(ContactsContract.Data.CONTACT_ID + "=? AND " +
>        ContactsContract.Data.MIMETYPE + "=?",
>        new String[]{id,
> ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE})
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME,
> displayName)
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME,
> familyName)
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.MIDDLE_NAME,
> middleName)
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME,
> givenName)
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.PREFIX,
> honorificPrefix)
>        .withValue(ContactsContract.CommonDataKinds.StructuredName.SUFFIX,
> honorificSuffix);
>
> mApp.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
>
> The contact gets modified correctly.  All of the new values show up
> for the Contacts name.
>
> However, if I look in my Contacts app there is a new contact called
> "(Unknown)" that shows up after I do a modify.  I can insert as many
> contacts as I want but every modify creates a new "(Unknown)" contact.
>
> Anyone have any ideas?
>
> Simon Mac Donald
> http://hi.im/simonmacdonald
>

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate