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
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810
Accepted Solution

4.7 Removing Switch application menu item

Hi all.

I recently tested my app on the Storm simulator and was surprised to see a new 'native' menu item "Switch application" on my menus.
Of course, along with it was the "Show keyboard" which I like Smiley Happy
The thing is, I already override makeMenu to remove native menu items like "Switch input language" but I cannot seem to remove the "Switch application"
Further more, if I put a breakpoint in makeMenu,  The "Switch application" and "Show keyboard" are not present, so I cannot remove them Smiley Sad

Has menu handling changed since 4.5 and/or 4.6 ?
How can I remove the "Switch application" while leaving the "Show keyboard" ?


"Listen carefully, I shall say this only once"
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: 4.7 Removing Switch application menu item

[ Edited ]

I have had no experience with this.. However I can suggest this.. You can remove both the menu items as you said and put in your own "Show Keyboard" and proceed with the following code on the run() of your "Show Keyboard" Menu Item..

 

 

VirtualKeyboard VKBoard = UiApplication.getUiApplication().getActiveScreen().getVirtualKeyboard();

VKBoard.setVisibility(VirtualKeyboard.SHOW);

 

 Cheers..

 

Edit: Code Formatting.. 

 

Message Edited by mantaker on 05-27-2009 02:56 PM
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Highlighted
Developer
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: 4.7 Removing Switch application menu item

Thanks for the tip, I will definitely use it somewhere.

 

But the point was more generic than this.

The problem is I want to allow specific menu items and remove other ones.

 

for instance I don't want the "clear field" but i like the "select" "copy" and "paste" items of the text field.

 

How come "Switch application" is handled differently than other menu items (It doesn't make a difference to me whether it's a context or main menu)



"Listen carefully, I shall say this only once"
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: 4.7 Removing Switch application menu item

Will this help you?

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800256/...

 

Cheers.. 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: 4.7 Removing Switch application menu item

Actually, no Smiley Happy

 

I even tried to make the menu empty by overriding:

 

public void makeMenu(Menu menu, int instance) { }

 And the 'Show Keyboard' and 'Switch Application' are still present on Storm!

 

How can I disable them? 

 

(info: my screen is extended from MainScreen) 

 

 



"Listen carefully, I shall say this only once"
Developer
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: 4.7 Removing Switch application menu item

I will answer myself:

 

The 4.7 introduced another menu option mask:

Screen.NO_SYSTEM_MENU_ITEMS

 

I am yet to discover all the consequences of using it, but id did remove The keyboard and switch application menu items.



"Listen carefully, I shall say this only once"
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: 4.7 Removing Switch application menu item

nice find. in the newer 4.6.1 versions (currently using build 250) the system menu items are also there, especially when a phone call is active.
i'll try to use it as a fixed long value and see if 4.2.1 gobbles it Smiley Happy
----------------------------------------------------------
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
Developer
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: 4.7 Removing Switch application menu item

"... especially when a phone call is active."

Wow !

Thx for the info, I would never find this out myself.

 

Also, please post the 4.2.1 status on this thread. (although I am supporting  >4.3 it's always good to know these system quirks)

 

Thanks again for the tip.

 



"Listen carefully, I shall say this only once"
Developer
Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: 4.7 Removing Switch application menu item

I tried this successfully in my code:

super(NO_VERTICAL_SCROLL | 262144); // 262144 NO_SYSTEM_MENU_ITEMS

 
On 4.2.1 devices it runs without complaint (after all it is just a bit sequence that fits the internal rim scheme), on my 4.6.1b250 device it sucessfully removes all the phone related menu items. Very helpful for one of my applications!

 

----------------------------------------------------------
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
Developer
Posts: 412
Registered: ‎09-12-2008
My Device: 9000 9810

Re: 4.7 Removing Switch application menu item

Great tip !

 

Thanks



"Listen carefully, I shall say this only once"