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


Audio Impedance Tester Portable CATIII Test Ranges 20/200/2000 Resistance Meter picture

Audio Impedance Tester Portable CATIII Test Ranges 20/200/2000 Resistance Meter

$84.99



Digital Ohmmeter LCD Audio Impedance Test Meter Speaker Voice Resistor System picture

Digital Ohmmeter LCD Audio Impedance Test Meter Speaker Voice Resistor System

$88.00



WPI ISOMIL Optically isolated high-impedence millivoltmeter picture

WPI ISOMIL Optically isolated high-impedence millivoltmeter

$199.00



IMPEDENCE MATCHING TRANSFOMER BNC F-BNC F, 50 OHM TO 75 OHM, 20-1100 MHZ picture

IMPEDENCE MATCHING TRANSFOMER BNC F-BNC F, 50 OHM TO 75 OHM, 20-1100 MHZ

$28.00



Fluke  845AR High Impedance Voltmeter-Null Detector picture

Fluke 845AR High Impedance Voltmeter-Null Detector

$500.00



SynVivo Cell Impedance Analyzer Catalog # 304001 picture

SynVivo Cell Impedance Analyzer Catalog # 304001

$1199.69







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