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
Highlighted
New Contributor
Posts: 7
Registered: ‎04-15-2010
My Device: 9530
My Carrier: Simulator Network

Conditionally displaying an ApplicationMenuItem when using MENUITEM_EMAIL_EDIT

I have an add-in to the messaging application menu using the ApplicationMenuItemRepository#addMenuItem function with MENUITEM_EMAIL_EDIT and an instance of my own ApplicationMenuItem.  It would be great if I could not show this menu entry based on attributes of the message being composed; specifically, exactly like the Send menu entry behaves.  The Send menu entry only shows up if the message has email addresses and is ready to be sent.

 

After thoroughly reading the documentation for AMIR#addMenuItem and MENUITEM_EMAIL_EDIT, it does not seem like this is possible.  The MENUITEM_EMAIL_EDIT constant does not specify anything to provide for the ApplicationDescriptor object or context object to addMenuItem.  I've found that ApplicationMenuItem#toString is not the place to do this.

 

Ideally, any solution would work on OS 4.2.1 and above, but 4.3 would be fine.