Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
sanj1504
Posts: 104
Registered: ‎06-25-2013
My Device: Z10
My Carrier: none
Accepted Solution

Contact create with postal address issues.

Hi,

    I am creating a contact app in which this line has some problem 

 

ContactBuilder build;

ContactService service;

// some more param

build.addPostalAddress(ContactPostalAddressBuilder()
.setLine1(" ")
.setRegion(" ")
.setCity(" ")
.setCountry(" ")
.setPostalCode(" "));

//

Contact con = service.createContact(build, false);

 

 

without this line addPostalAddress it is working fine, but when i am using this line it is unable to create.

 

Regards,

Sanjeev

Please use plain text.
Developer
zezke
Posts: 1,004
Registered: ‎12-12-2010
My Device: Z10 (red Limited Edition)
My Carrier: Mobile Vikings

Re: Contact create with postal address issues.

I suppose you're adding real data and not just empty strings? Did you check the output of ContactPostalAddressBuilder?

-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Please use plain text.
Developer
sanj1504
Posts: 104
Registered: ‎06-25-2013
My Device: Z10
My Carrier: none

Re: Contact create with postal address issues.

I was missing ".setSubKind(AttributeSubKind::Home)"

 

build.addPostalAddress(ContactPostalAddressBuilder()
.setLine1(" ")
.setRegion(" ")
.setCity(" ")
.setCountry(" ")
.setPostalCode(" ")

.setSubKind(AttributeSubKind::Home));

 

Now it is working.

Please use plain text.