Hi y'all:

Has anyone had any success updating the phone number on a contact?

I can't seem to get the Uri right.

Here's the google documentation: (yes, this is ALL of it)
Modifying Data
To batch update a group of records (for example, to change "NY" to
"New York" in all contact fields), call the ContentResolver.update()
method with the columns and values to change.

So that led me to something that looked like this:

Uri phoneUri = Uri.withAppendedPath(mContact,
People.Phones.CONTENT_DIRECTORY);

//update Phone entry for contact
values.clear();
values.put(People.Phones.TYPE, Contacts.Phones.TYPE_MOBILE);
values.put(People.Phones.NUMBER, number);

//call update to apply data to uri
getContentResolver().update(phoneUri, values, null, null);

but this code always gives me an exception, saying i cannot update the
following url:
content://contacts/people/x/phones
where x is the id of the contact

i've also tried that URL with a WHERE clause, but i still get the
"cannot modify url" message.

So what URL do I modify to update a phone number?
Thanks!

Cheers,
Chris

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

Reply via email to