Possible Duplicate:
How to add new contacts in android
how can i add a name to the contacts? I have two spinners, one for the firstname and one for the lastname. The assigned variables are linkname1 and linkname2. When user pushes the OK button (these are all in a dialog), the name (linkname1 + " " + linkname2) should be added to the contacts. I can read the contacts but how do i write it?
Thanks
Update: I also tried this:
newname = linkname1 + " " + linkname2;
ContentValues values = new ContentValues();
vales.put(ContactsContract.Contacts.DISPLAY_NAME, newname);
and this:
StringBuffer strBuf = new StringBuffer();
strBuf.append(linkname1);
strBuf.append(" ");
strBuf.append(linkname2);
ContentValues values = new ContentValues();
values.put(ContactsContract.Contacts.DISPLAY_NAME, strBuf.toString());
But the new name is not appearing in the contact list.