11-19-2009 01:12 AM
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.
Solved! Go to Solution.
11-19-2009 04:27 AM
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.
11-19-2009 06:32 AM
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
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.
11-19-2009 06:41 AM
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.
06-21-2012 04:53 PM
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
So far only managed to get rid of "Switch Application"...