Hi!
I'm creating an app that needs to create a contact. My 1st attempt
was:

ContentValues values = new ContentValues();
values.put(Contacts.People.NAME, "Name");
values.put(People.Phones.TYPE, People.Phones.TYPE_MOBILE);
values.put(People.Phones.NUMBER, "+11111");
Uri myUri = getContentResolver().insert(People.CONTENT_URI,values);

This creates an exception: "column "NUMBER" is invalid" (huh?)

It seems People.Phones.NUMBER is deprecated so I tried to use
ContactsContract. Unfornately ContactsContract and RawContacts are not
resolved (using Eclipse) unless... I change the project target to 7.
Since I need the app to run on target 3 (1.5), could please someone
tell me how to add a contact - that works on always versions?

Thanks in advance!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to