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
Contributor
graymatter
Posts: 28
Registered: ‎07-29-2010
My Carrier: Verizon
Accepted Solution

Avoiding duplicate MENUITEM_SYSTEM menu entries

I've been working on adding a user optional feature to my application where the user can choose to include an item in the system menu for launching the application.  However, one issue that is perplexing me is how I would go about ensuring that I don't add another item to the menu when one is already in existence.  I've been looking through the RIM API's but cannot seem to locate a method where I can check if my item already exists in the system menu.

 

I suppose I could keep track of the addition of the item through the applications persistent settings, however, it seems cleaner and less prone to issues if I could actually check the menu item repository for the actual existence of the menu item instead.  Is there an API that will allow me to do this that I'm missing?

 

Thanks in advance,

 

Russ.

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

Re: Avoiding duplicate MENUITEM_SYSTEM menu entries

you are correct, there are no such methods.

i use two different approaches to solve this:
- either register the menu items in an autostart entry point
- or use the runtimestore to store the registered item. you can check if the store is empty to see if the item is already registered, and you can retrieve the item to unregister it as well.
----------------------------------------------------------
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.
Contributor
graymatter
Posts: 28
Registered: ‎07-29-2010
My Carrier: Verizon

Re: Avoiding duplicate MENUITEM_SYSTEM menu entries

Thank you simon!  I had a feeling that would be the case, I will keep track of it in the runtime store as you suggest.

 

Thanks again!

 

Russ.

Please use plain text.