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
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Removing system menu?

Hi,

 

I got a way to add menu item in system menus in blackberry using

a) ApplicationMenuItemRepository.getInstance()
.addMenuItem(ApplicationMenuItemRepository.MENUITEM_SYSTEM, this);

and there is also a method to remove menu item

b) ApplicationMenuItemRepository.getInstance()

.removeMenuItem(ApplicationMenuItemRepository.MENUITEM_SYSTEM, this);

i am able to add menu items but unable to delete or remove it so please helm me out how can i use b) for removing menu items

 

Thanks & Regards

Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Removing system menu?

you have to store a reference to the menu item you add.
i suggest to use the runtimestore, but you can use other methods 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.
Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: Removing system menu?

can u provide me code for this or any document relating to this
Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Removing system menu?

runtimestore is fairly easy to use.

you call http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/RuntimeStore.html#put(l... to put your menu item in it, and when you want to delete it call get with the same long (you can use the string to long function to create one in eclipse) and use this object for removeMenuItem.

the runtimestore stays until a hard reboot, same as the menu item, so they make a good team.
----------------------------------------------------------
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.
Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: Removing system menu?

can i add system menus like of inbuilt message box menu items in it..
Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Removing system menu?

the runtimestore takes Object, you can put anything in it. If it makes sense is another question.
----------------------------------------------------------
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.