views:

269

answers:

1

Hi,

My issue is quite simple I think :

I would like to be able to add a contact to the contact list by a simple click on a button (and be able to test it on the emulator). The data of this contact would be stored in the source code of the application. is there an easy way of doing that?

thank you for your answers

+2  A: 

The only easy way to insert a contact is to use an INSERT action, where you supply some of the data and start up an activity for the user to provide the rest and confirm adding it to the contacts list. Here is a sample project demonstrating this.

CommonsWare
Thanks Mr Murphy, I'll have a look and post here if I have a problem
Sephy
If I want to add an icon or a secondary email though, it doesn't seem to work. even if I use Insert.SECONDARY_EMAIL_TYPE(and i don't know what to use and if it ise possible for the icon)
Sephy