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

Java Development

Reply
Regular Contributor
Posts: 69
Registered: ‎01-17-2010
My Device: 9700 Bold
My Carrier: Airtel

BlackBerry->Contact->Address Field

[ Edited ]

Hi Everyone

 

I need to remove the ADDRESS field from the BlackBerry contact, can any one suggest me how to do this? I tried the following thing, but it gives me FieldFullException.

 

  if(contact.countValues(Contact.ADDR)>0)

  {
       for(int i = 0; i < contact.countValues(Contact.ADDR); i++)
      contact.removeValue(Contact.ADDR,i);
  }

 

It'll be really helpful if you can provide some information.

 

thanks n regards

Abhishek

AbhishekPXP
Developer
Posts: 516
Registered: ‎07-23-2010
My Device: 9900

Re: BlackBerry->Contact->Address Field

instead of trying to remove the address value, try setting it to null.

Let me know if that works.

Developer
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Re: BlackBerry->Contact->Address Field

Do u maen to say that while fetching data from contacts u dont want to fetch address field data???????

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: BlackBerry->Contact->Address Field

it is always a bad idea to iterate over something and change it in the same iteration.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Regular Contributor
Posts: 69
Registered: ‎01-17-2010
My Device: 9700 Bold
My Carrier: Airtel

Re: BlackBerry->Contact->Address Field

Hi swati,

 

i had fetched a  blackberry contact and now i want to remove each and every field of it. I successfully removed all other fields except the ADDRESS and NOTE fields. i want a solution to remove them. Pls see the code snippet attached with the privious post.

 

regards

Abhishek

AbhishekPXP
Regular Contributor
Posts: 69
Registered: ‎01-17-2010
My Device: 9700 Bold
My Carrier: Airtel

Re: BlackBerry->Contact->Address Field

Hi Simon,

 

i'm not iterating over something, i'm having a full contact already with me. I just want to remove each n every field of it.

 

please provide me if you have some solution.

 

regards

Abhishek

AbhishekPXP
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: BlackBerry->Contact->Address Field

 


abhishek_puppalwar wrote:

Hi Everyone

 

I need to remove the ADDRESS field from the BlackBerry contact, can any one suggest me how to do this? I tried the following thing, but it gives me FieldFullException.

 

  if(contact.countValues(Contact.ADDR)>0)

  {
       for(int i = 0; i < contact.countValues(Contact.ADDR); i++)
      contact.removeValue(Contact.ADDR,i);
  }

 

It'll be really helpful if you can provide some information.

 

thanks n regards

Abhishek


 

lets say the contact has 2 values.

first run:

i = 0. <2? true. delete the one at 0. contact has now only 1 value left.

i = 1. <1? false

this means you are removing all but one.

(i have not checked the functionality of the code, only hinting at the logic)

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Regular Contributor
Posts: 69
Registered: ‎01-17-2010
My Device: 9700 Bold
My Carrier: Airtel

Re: BlackBerry->Contact->Address Field

hey buddy,

 

can u tell me how to use 'contact.setString(int,int.int.String)'  and contact.setStringArray(int,int,int,String[])

 

regards

Abhishek

AbhishekPXP