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
mindus
Posts: 128
Registered: ‎11-05-2009
My Device: 9700
Accepted Solution

Delete or remove switch application from menu item

Hi

 

I am using blackberry 4.3 api for my application and i am testing this application in my 4.7 api simulators(9500/9530).

 

I dont want to delete all default menus (like showkeyboard/hide keyboard, show symbols, close, switch application).

 

I want to delete or remove only switchapplication from the menu item. If is it possible then can u please give some more

 

information about this issue.

 

Thanks

mindus

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Delete or remove switch application from menu item

You could override Screen.makeMenu, invoke super.makeMenu, and then find the Switch Application menu item in the Menu instance and remove the item. You could locate the item by ordinal ID.

 

P.S. I'm quite curious about your resons for wishing to remove the Switch Application menu item. First of all, this breaks the BlackBerry GUI guidelines. Secondly, on newer builds of handheld software the user can still invoke the application switcher simply by holding the menu key down for a second or so.

Developer
mindus
Posts: 128
Registered: ‎11-05-2009
My Device: 9700

Re: Delete or remove switch application from menu item

Hi

 Thanks for your reply.

 

i did exactly what u have suggested. I override the Screen.makMenu method and invoked super.makeMenu() iterated through all menu items. Surprisingly i am unable to locate the switch application menuItem. It only contains close menuItem.

 

Basically i want to show switch application menu item on one of the screens.

 

My application should run even the device which doesnt have switch application menuItem (eg 8130/8120) so i implement my own switch application menuItem. But if i install my application in other devices like 8520/9530 etc , i am getting two switch application menuItem. so i need to remove the default switch application from the menu

 

I visited the following thread

http://supportforums.blackberry.com/t5/Java-Development/4-7-Removing-Switch-application-menu-item/m-...

 

The problem described in above thread is exactly same as mine.

 

The thread is concluded that if we use NO_SYSTEM_MENU (262144) constant as a constructor parameter. It will disable all the default system menus. But that doesn't help us as we require some of crucial system menu items (eg show keyboard/hide keyboard, Switch input language) . So only want to remove specific system menu items like switch application.

 

 

mindus

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Delete or remove switch application from menu item

Sorry, my mistake. You're right, you can't see the default system menu items in makeMenu. Instead, you override getMenu, invoke super.getMenu(), and then search & remove. The ordinal is 268501000 (it's a hack, as this number may change).

 

I think you should be solving your issue slightly differently. I suggest you only add your own Switch Application menu item if the OS does not provide its own, as the OS provided item will work better.

New Contributor
amina_khalique
Posts: 6
Registered: ‎06-19-2012
My Device: Developer

Re: Delete or remove switch application from menu item

Sorry but can u give like a code example?
I'm not really sure what you mean by search and remove..
What I'm trying to do is get rid of the meny that pops up that says
"Switch Application"
"Full Menu"

So far only managed to get rid of "Switch Application"...