BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 08-04-2010, 06:36 AM   #1 (permalink)
New Member
 
Join Date: Aug 2010
Model: 9000
PIN: N/A
Carrier: orange
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default 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) {
Offline  
Old 08-04-2010, 08:01 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

What is the exact exception?
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

New lot of 2pcs ZIP-20 Sockets - 20-pin Zigzag inline package - Amiga 3000
$1.0
New lot of 2pcs ZIP-20 Sockets - 20-pin Zigzag inline package - Amiga 3000 pictureMOS MPS 6520 Commodore Amiga Atari PIA 40-Pin PDIP Used
$10.0
MOS MPS 6520 Commodore Amiga Atari PIA 40-Pin PDIP Used  pictureLOT(4)RADSTONE VME BOARD PME 68-33 MOTOROLA 6800 33Mhz AMIGA PPC SCSI 16MB
$1800.0
LOT(4)RADSTONE VME BOARD PME 68-33 MOTOROLA 6800 33Mhz AMIGA PPC SCSI 16MB pictureRADSTONE VME BOARD PME 68-33 MOTOROLA 6800 33Mhz AMIGA PPC SCSI 16MB
$600.0
RADSTONE VME BOARD PME 68-33 MOTOROLA 6800 33Mhz AMIGA PPC SCSI 16MB pictureRADSTONE VME BOARD PME 68-31 MOTOROLA 6800 33Mhz AMIGA PPC Module card SCSI
$500.0
RADSTONE VME BOARD PME 68-31 MOTOROLA 6800 33Mhz AMIGA PPC Module card SCSI picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.