PDA

View Full Version : Examples for creating contacts in Android 2.0?



smoger
11-09-2009, 11:12 AM
Hey everyone... this whole ContactsContract thing is such a mess! My apps have an option to easily create a contact, but it no longer works in API level 5 using "Contacts.People.createPersonInMyContactsGroup".

Does anyone have an example of doing the same using the new method(ContactsContract) ?Google's documentation is pretty bad.

Also, am I crazy or did they remove "send calls directly to voicemail" from Android 2.0?

Anyway, thanks in advance..

smoger
11-09-2009, 01:50 PM
Answering part 1 of my own question.. it was actually quite easy and probably would have worked almost exactly the same way in <2.0 (though before I was doing it without a dialog.. this is better anyway).. in case anyone comes along from google..

Intent i = new Intent(Intent.ACTION_INSERT_OR_EDIT);
i.putExtra(ContactsContract.Intents.Insert.NAME,"John Johnson");
...
i.setType(ContactsContract.Contacts.CONTENT_ITEM_T YPE);
startActivity(i);

Now,.. as for the ability to send calls directly to voicemails..? Anyone have any insight?