BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-15-2007, 12:48 PM   #1 (permalink)
New Member
 
Join Date: Feb 2007
Model: 7100T
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Add a MenuItem to MENUITEM_ADDRESSCARD_VIEW

Please Login to Remove!

Hi,

I'm trying to add a menuItem to the contact's contextMenu for every contact with email address, and for those who does not have an email address i want to grey the menu or remove it.

all i managed to do is add a menuItem to all contacts.
I tried to add an ApplicationMenuItem with specific Contact context from the PIM:

Code:
Contact c = (Contact)contacts.elementAt(i);
amir.addMenuItem(ApplicationMenuItemRepository.MENUITEM_ADDRESSCARD_VIEW, new SampleMenuItem(c));
contacts is a vector of PIM Contacts
amir is ApplicationMenuItemRepository
SampleMenuItem is a class that extends ApplicationMenuItem

Is this code is right? what am i missing here?

I see no difference between ApplicationMenuItem contructor with Contact context and the constructor without Contact context.

public ApplicationMenuItem(Object context, int order)
public ApplicationMenuItem(int order)

thanks
Eitan.
Offline  
Old 02-18-2007, 01:15 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2006
Model: 8707g
Carrier: Hutch
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Current API's don't allow you to selectively show ApplicationMenuItems depending on conditions. It will always be visible for all types of contacts in your case. However you can try getting the selected contact and change the text of the menu.
The text to be shown in menu can be changed by returning a different value from toString() method.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

H127449 Edwards E2M30 Rotary Vane Vacuum Pump w/ Leroy Somer Motor LS90PR
$750.0
H127449 Edwards E2M30 Rotary Vane Vacuum Pump w/ Leroy Somer Motor LS90PR pictureH127534 Fluidigm BioMark Vacuum Station VS-00130
$200.0
H127534 Fluidigm BioMark Vacuum Station VS-00130 picture6x Swooper Flags Free Vacuum With Wash Red Yellow
$96.88
6x Swooper Flags Free Vacuum With Wash Red Yellow picture6x Swooper Flags Free Vacuum With Wash Yellow Red
$96.88
6x Swooper Flags Free Vacuum With Wash Yellow Red pictureH127543 Leybold Thermovac Vacuum Sensor TR301 15740
$25.0
H127543 Leybold Thermovac Vacuum Sensor TR301 15740 picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.