BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-22-2010, 12:19 AM   #1
vladt
New Member
 
Join Date: Jul 2010
Model: 9630
PIN: N/A
Carrier: Verizon
Posts: 11
Default hide default menu items

Please Login to Remove!

Hi. I want to display context menu without default items in it. It does not seem to matter that I erase the list, the default items (Close, Switch Application, Show Keyboard) do not disappear. Here's couple variations of the code.

private MenuItem mnuNewAcct=new MenuItem("New Account", 1, 10) {
public void run() {
//
}
};

protected void makeMenu(Menu menu, int context) {
menu.deleteAll();
menu.add(mnuNewAcct);
super.makeMenu(menu, context);
}

/***** OR *****/

protected void makeContextMenu(ContextMenu contextMenu) {
contextMenu.clear();
contextMenu.addItem(mnuNewAcct);
super.makeContextMenu(contextMenu);
}


protected boolean navigationClick(int status, int time) {
ContextMenu menu = this.getScreen().getContextMenu();
makeContextMenu(menu);
this.getScreen().onMenu(0);
return true;
}
Offline  
Old 07-22-2010, 01:23 AM   #2
nanika
Knows Where the Search Button Is
 
Join Date: Mar 2008
Location: Paris, France
Model: None
PIN: N/A
Carrier: None
Posts: 36
Default

As long as you call the "super" methods last you'll get the default entries, of course!
Offline  
Old 07-22-2010, 01:51 AM   #3
vladt
New Member
 
Join Date: Jul 2010
Model: 9630
PIN: N/A
Carrier: Verizon
Posts: 11
Default

Sorry, I should have removed it from the example. It does not make any difference if I have super or not. When I don't have it, the default menu items are added anyway. By the way, I'm on JDE 5.0, 9530 SIM. Thanks.
Offline  
Old 07-22-2010, 05:59 PM   #4
vladt
New Member
 
Join Date: Jul 2010
Model: 9630
PIN: N/A
Carrier: Verizon
Posts: 11
Default

To close the loop on this. The only way I was able to get rid of the default items on the menu was to subclass Menu into my own class and instantiate and show that. No matter what I tried with the default menu, it would always add the Switch Application and Show Keyboard items to the end of it.
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


4 Count Case GE ProLine 2 Bulb 120V T12 Electronic Fluorescent Light Ballasts picture

4 Count Case GE ProLine 2 Bulb 120V T12 Electronic Fluorescent Light Ballasts

$49.99



Lot Of 3 Philips Advance ICN-2S110-SC Ballast ICN2S110SC picture

Lot Of 3 Philips Advance ICN-2S110-SC Ballast ICN2S110SC

$45.99



Philips ADVANCE AmbiStar RELB-2S40-N Replacement Ballast 40-Watt 2-Lamp T12 picture

Philips ADVANCE AmbiStar RELB-2S40-N Replacement Ballast 40-Watt 2-Lamp T12

$18.79



Fulham Pony Solid State electronic ballast picture

Fulham Pony Solid State electronic ballast

$15.00



Sylvania OSRAM 51473 -No Leads- QHE 2x28T5/UNV PSN 120/277V Ballast (20 Case) picture

Sylvania OSRAM 51473 -No Leads- QHE 2x28T5/UNV PSN 120/277V Ballast (20 Case)

$283.50



NEW ICN2S54T35I Philips Advance Electronic 54W 2 Lamp T5 Fluorescent Ballast picture

NEW ICN2S54T35I Philips Advance Electronic 54W 2 Lamp T5 Fluorescent Ballast

$24.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.