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
Trusted Contributor
amrinder_singh
Posts: 158
Registered: ‎03-09-2010
My Device: 8900
My Carrier: developer
Accepted Solution

regarding blackberry contact list

i want to select the contact for sending it to other number .as i select the contact it again appears the blackberry contact list .i don ot want to appear it again

 

i write this code:

"_contactList = (BlackBerryContactList)PIM.getInstance().openPIMList(PIM.CONTACT_LIST,PIM.READ_WRITE);"

 PIMItem item = _contactList.choose();"

 

i want that ,when i go to address book list ,then the whole list should be appear as .when i select the contact ,then it does not get the Blackberry Contact list again"

 

please help

 

 

thanks and regards

amrinder singh

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: regarding blackberry contact list

Sorry, what you have written is not clear to me.

 

When you do a

PIMItem item = _contactList.choose();

this will display the contact list.  you select one, and control should return to your program.  Is this not what happens?

Please use plain text.
Trusted Contributor
amrinder_singh
Posts: 158
Registered: ‎03-09-2010
My Device: 8900
My Carrier: developer

Re: regarding blackberry contact list

sir,

 

I had added the application menu item to the blackberry device .

The menu item is added in the addressbook list  of blackberry device ,when i go to the address book list ,then the added menu item appears named as "card" .

With this applictaion MenuItem  ,Contact list is appeared .i want to selct it from this BlackberryContactList ,but

   if i use  "

PIMItem item = _contactList.choose();" ,then it again appear the  BlackBerryContactList ,and then the contact is selected from the contact list .

 

I want to invoke the  BlackBerryContactList once .

 

Is there any way of selecting it from the address book list ?

 

Thanks and regards

Amrinder Singh

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: regarding blackberry contact list

No need to call me sir.......  I have not been knighted.  :smileysad:

 

You are adding an ApplicationMenuItem, the context Object that is passed into the run method should be the currently selected contact.

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: regarding blackberry contact list

No need to call me sir.......  I have not been knighted

 

...not yet...   :smileyhappy:

 

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: regarding blackberry contact list

<hijack>

 

Thanks RexDoug!  Please email thequeen@buckinghampalace.org

 

Actually I have just found this:

http://britannichost.co.uk/index.html

 

So all I need is £149!!!!!  :smileysurprised:

 

</hijack>

 

 

Please use plain text.
Trusted Contributor
amrinder_singh
Posts: 158
Registered: ‎03-09-2010
My Device: 8900
My Carrier: developer

Re: regarding blackberry contact list

[ Edited ]

hi

code is hereby  ,but want to select the Contact From blackberry Address Book .please help

 

package addMenuItem;


import net.rim.device.api.ui.UiApplication;
import net.rim.blackberry.api.menuitem.*; // ApplicationMenuItemRepository

public class MenuDemo extends UiApplication
{
 // one and only instance of application
 static MenuDemo theApp = null;
 // constructor

 public MenuDemo()
 {
  // setup menu(s)
  LMMenu lmm = new LMMenu(0);
  
  ApplicationMenuItemRepository.getInstance().
 
  addMenuItem(ApplicationMenuItemRepository.MENUITEM_ADDRESSBOOK_LIST,lmm);
 }
 public static void main(String[] args)
 {
  theApp = new MenuDemo();
  
  if (theApp != null)
  
  {
   theApp.enterEventDispatcher();
      
  }
 }
}

 

The above code add the Application Menu item in the Address Book list of blackberry .

 

when i press the Application menu item then this below class run :

 

public Object run (Object Context)

{

try

{

 _contactList =

(BlackBerryContactList)PIM.getInstance().openPIMList(PIM.CONTACT_LIST

,PIM.READ_WRITE);

}

catch (PIMException e)

{

e.printStackTrace();

}

 

PIMItem item = _contactList.choose();

}

this above class Again return the BlackberryContactList ,i want to select the Contact from the Address Book List Which is first called .

thanks and regards

amrinder singh

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

Re: regarding blackberry contact list

remove the code from your menu items run method. you get Object Context as a parameter. this object is a contact, you can work with it. no need to call choose or open the contact list.
----------------------------------------------------------
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.
Trusted Contributor
amrinder_singh
Posts: 158
Registered: ‎03-09-2010
My Device: 8900
My Carrier: developer

Re: regarding blackberry contact list

[ Edited ]

hi ,

 

First, I go to the Contacts Tab of the blackberry Device ,then

blackberry contact List appears,then i press the menu button of the Backberry Device ,then the MenuList appears such as

                                                "my Named Menu Item(which is named by me )

                                                 help

                                                 Filter

                                                 New Contact

                                                 New Group

                                                 View

                                                 Edit

                                                 Delete

                                                 Activity Log

                                                  .

                                                  .

                                                  .                 "

 

then i press the "my Named Menu Item"

then again the Blackberry Contact List appears .

then i able to select the contact .

 

 

i want that ,first time ,when the Blackberry contact list appears ,then i press the "my Named Menu Item" then the Contact  is selcted For sending .

 

 

i able to selct the Contact After writting this Code

_contactList

= (BlackBerryContactList)PIM.getInstance().openPIMList(PIM.CONTACT_LIST,PIM.READ_WRITE

);"

please help

thanks and regards

amrinder singh

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: regarding blackberry contact list

[ Edited ]

As both Simon and I have said, you get the selected Contact supplied to you.  You will note that your run method looks like:

 

public Object run (Object Context)

 

The Context in this case is the selected Contact.

 

Check this out using the debugger.

Please use plain text.