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
Developer
narendra
Posts: 218
Registered: ‎02-20-2009
My Device: Not Specified
Accepted Solution

How to select a contact from Address Book ?

Hi,

 

    I would like to select a contact from address book and show it in a BasicEditField of my application.

What I have done so far is,  can call Address book using following code.

AddressBookArguments addressBook = new AddressBookArgumentsAddressBookArguments.ARG_COMPOSE); Invoke.invokeApplication(Invoke.APP_TYPE_ADDRESSBOOK, addressBook);

 

 But  I dont have an idea about how to add seleted contact's phone to specified BasicEditField.

 

 can anyone give me some information regarding this.

 

 any help will be highly appreciated.

 

thanks.

narendra

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: How to select a contact from Address Book ?

Populate Address book in your application and use it.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800363/How_To_...


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
cream8tor
Posts: 30
Registered: ‎05-07-2009
My Device: Not Specified

Re: How to select a contact from Address Book ?

The problem with using AddressBookArguments and Invoke.invokeApplication() is that there is no way to figure out which contact the user actually selected. Try using net.rim.blackberry.api.pdap.BlackBerryContactList.choose(). Its javadocs read "Launches the address book so that the user can pick an address" and it returns "PIMItem for the Contact or BlackBerryContactGroup selected by the user; returns null if user did not make a selection."

Link to javadocs:http://www.blackberry.com/developers/docs/5.0.0api/net/rim/blackberry/api/pdap/BlackBerryContactList...
Please use plain text.