Hello scimitar,
You cannot put People.NUMBER for People.CONTENT_URI because that
contentprovider does not have NUMBER column in database.
Try removing that line;
ContentValues mv = new ContentValues();
mv.put(People.NAME, "foo");
Uri u = getContentResolver().insert(People.CONTENT_URI, mv);
After getting the uri with newly inserted _id, use
Contacts.Phones.CONTENT_URI in order to insert phone number of that
person.
ContentValues mvPhones = new ContentValues();
mvPhones.put(Contacts.Phones.NUMBER, "54547");
mvPhones.put(Contacts.Phones.PERSON_ID, personIdFromUri);
getContentResolver().insert(Contacts.Phones.CONTENT_URI, mvPhones);
Hope this helps,
Best wishes,
-sacoskun
On May 6, 2:10 pm, scimitar <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm always getting null as the return uri for
> getContentResolver().insert(). Why is this?
>
> ContentValues mv = new ContentValues();
> mv.put(People.NAME, "foo");
> mv.put(People.NUMBER, "54547");
> Uri u = getContentResolver().insert(People.CONTENT_URI, mv);
>
> thanks,
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---