how to:add data to contact and create contact to cotact list progrematically
Please Login to Remove!
i use this code in order to save data into contact that i created with my app.
i keep getting exception but im not sure why..
anyone can help me with that??
case 3:
ButtonField buttonfield3 = (ButtonField) field;
try {
ContactList contactList = (ContactList)PIM.getInstance().openPIMList(PIM.CON TACT_LIST, PIM.WRITE_ONLY);
if (contactList.isSupportedField(Contact.NAME)) {
Contact contact = contactList.createContact();
String[] name = new String[ contactList.stringArraySize( Contact.NAME ) ];
name[Contact.NAME_GIVEN] = "Kate";
name[Contact.NAME_FAMILY] = "Turner";
contact.addStringArray(Contact.NAME, Contact.ATTR_NONE, new String[] {"Kate Turner"});
try{
contact.commit();
}
catch (Exception e) {
|