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
New Developer
mdwheaton
Posts: 37
Registered: ‎07-15-2008
My Device: Not Specified

Retrieve individual Contact without having to iterate the whole contact list?

If I have the UID of a BlackBerryContact, is there any way to retrieve that individual contact, at will, without having to iterate the whole contact list from scratch?

Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Retrieve individual Contact without having to iterate the whole contact list?

you could try BlackBerryContactList.itemsByName, but i don't know if it searches with the UID.
other than this i only know a shortcut from name to contact, using phonecallid.
----------------------------------------------------------
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
Please use plain text.
New Developer
mdwheaton
Posts: 37
Registered: ‎07-15-2008
My Device: Not Specified

Re: Retrieve individual Contact without having to iterate the whole contact list?

Hi Simon,

 

Could you give me a short example of what you mean by a shortcut from name to contact using phonecallid?

Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Retrieve individual Contact without having to iterate the whole contact list?

ah, it was from number to name.
create a new PhoneCallLogID object with the number you have. call getName(), it it returns not null you get the contact.
----------------------------------------------------------
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
Please use plain text.
Developer
AlexXF
Posts: 323
Registered: ‎03-10-2010
My Device: Bold 9780, DevAlpha
My Carrier: Vodafone CZ

Re: Retrieve individual Contact without having to iterate the whole contact list?

BlackBerryContactList.getByUID(String uid)

Please use plain text.