This discussion is archived
0 Replies Latest reply: May 12, 2010 6:42 AM by 843851 RSS

Problem adding new contacts

843851 Newbie
Currently Being Moderated
Hi ,
i have developed an application for adding new contacts in sonyericsson phone .
But its not working fine .please give me solution for this problem.The code that i have used for adding contacts is given below.
try {            
            Contact contact          =   null;
            PIM pimInst              =   PIM.getInstance();
            contactList            =   (ContactList) pimInst.openPIMList(PIM.CONTACT_LIST,PIM.READ_WRITE); 
            contact                  =   contactList.createContact();             
        
            String[] name            =   new String[contactList.stringArraySize(Contact.NAME)];
            name[Contact.NAME_GIVEN]  = "Manju";
                  name[Contact.NAME_FAMILY] = "Varma";
                  
              contact.addStringArray(Contact.NAME, Contact.ATTR_NONE,name);    
                  
       
        
            contact.commit();         
           
        }catch (PIMException ex) {            
                       
        }