BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 08-04-2010, 06:36 AM   #1
Omri
New Member
 
Join Date: Aug 2010
Model: 9000
PIN: N/A
Carrier: orange
Posts: 11
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
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

What is the exact exception?
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


OEM Dell XPS 8910 8920 8930 Alienware Aurora R5 R6 R7 Front Cooling Fan 7M0F5 picture

OEM Dell XPS 8910 8920 8930 Alienware Aurora R5 R6 R7 Front Cooling Fan 7M0F5

$14.63



DELL 330-6581 3306581 725-10229 OEM LAMP FOR 1510X 1610HD 1610X  - Made By DELL picture

DELL 330-6581 3306581 725-10229 OEM LAMP FOR 1510X 1610HD 1610X - Made By DELL

$39.98



New Genuine Dell OEM G Series G5 5590 Heatsink Assembly 35YK5 035YK5 1RGDW picture

New Genuine Dell OEM G Series G5 5590 Heatsink Assembly 35YK5 035YK5 1RGDW

$10.99



Dell OEM Latitude Rugged Extreme 7404 GPS Antenna Junction Cable Cable KMX0M picture

Dell OEM Latitude Rugged Extreme 7404 GPS Antenna Junction Cable Cable KMX0M

$2.95



Genuine OEM Dell 2375 B2375dnf B2375dfw 110V Fuser fixing N41P2 sku 724-BBCI picture

Genuine OEM Dell 2375 B2375dnf B2375dfw 110V Fuser fixing N41P2 sku 724-BBCI

$94.99



OEM Dell 3310 2 in 1 LCD Touch Screen D2TNH NV133FHM-T00 06GHX8 picture

OEM Dell 3310 2 in 1 LCD Touch Screen D2TNH NV133FHM-T00 06GHX8

$54.00







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