06-01-2011 05:51 AM
Hi..,
I have designed a screen with device orientation. When the user showing the virtual keayboard, my screen design gets collapsed. There is no editfields in my screen. So I want to remove the "Show Keyboard" menu from the menu list. I have tried NO_SYSTEM_MENU_ITEMS in the screen. But it removes "Switch application" menu also. I just want to remove the "Show Keyboard" only.. Please help me..
Thanks...
Solved! Go to Solution.
06-07-2011 05:30 PM - edited 06-07-2011 05:31 PM
Hi razebond,
For the Virtual Keyboard specifically, you can get a handle on the Screen's designated Virtual Keyboard as outlined in the following document:
From here, you can call VirtualKeyboard.setVisibility(VirtualKeyboard.HIDE
Alternatively, you could override your Screen's makeMenu() method and use a for loop in conjunction with Menu.getsize() to traverse your Menu's items and look for the item with text Show Keyboard. Once found, you can call Menu.deleteItem(int position) on the location of the Show Keyboard item.
This removal would best follow a call to super.makeMenu(Menu menu, int instance) to ensure that the Menu has already been populated.
In your case, the recommendation would be to fully disable the Virtual Keyboard as it is a much cleaner approach.
Erik Oros
BlackBerry Development Advisor
06-08-2011 03:32 AM
06-08-2011 06:20 AM - edited 06-08-2011 06:21 AM
Thanks oras and simon..
I have used HIDE_FORCE. Its working.
Thanks again.
07-27-2011 05:03 AM
aahhh , i am doing all this stuff in my screen's constructor !! and its not doing the desired job ....
where i need to write the code ?
while overriding the makemenu?
in the construction of the screen?
where ?
07-27-2011 11:51 AM
Hello jai1989,
Personally I would recommend taking the code out of the constructor and placing it after your screen has completely finished creation as in the noted sample:
In your case, instead of calling:
virtKbd.setVisibility(VirtualKeyboard.SHOW);
You would call:
virtKbd.setVisibility(VirtualKeyboard.HIDE_FORCE);
Erik Oros
BlackBerry Development Advisor
07-28-2011 03:02 AM