07-25-2009 06:19 AM
Hi, I have the following code to set the website URL of a Contact and will use Contact.NOTE to create a note.
if(contactList.isSupportedField(Contact.URL) && contactList.isSupportedAttribute(Contact.URL, Contact.ATTR_WORK)){ contact.addString(Contact.URL, Contact.ATTR_WORK, this.addressBookWebsite);}
Is the Contact.ATTR_WORK necessary for entering a website?
It's just that addString must input a field and attribute.
07-27-2009 09:03 AM
Take a look at the javadocs for net.rim.blackberry.api.pdap.BlackBerryContact, which say which field support which attributes. Only Contact.TEL and Contract.ADDR fields support the ATTR_WORK attributes, and therefore it is probably ignored when used in the Contact.URL field. You can just use PIMItem.ATTR_NONE when adding the URL field; namely,
contact.addString(Contact.URL, PIMItem.ATTR_NONE, this.addressBookWebsite);
You don't need to worry about testing contact.isSupportedAttribute(Contact.URL, PIMItem.ATTR_NONE)