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


Thread Tools

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


[1pcs] 8520A-1 CSG 8520A-1  Commodore Amiga DIP40 USED picture

[1pcs] 8520A-1 CSG 8520A-1 Commodore Amiga DIP40 USED

$15.57



New Greaseweazle V4.1 USB Floppy Adapter Flux Reader Writer Amiga Atari ST 1591 picture

New Greaseweazle V4.1 USB Floppy Adapter Flux Reader Writer Amiga Atari ST 1591

$28.46



6500/1 A 6502 VARIENT CPU COMMODORE USE IN AMIGA KB & 1520 PLOTTER NMOS NCR NOS picture

6500/1 A 6502 VARIENT CPU COMMODORE USE IN AMIGA KB & 1520 PLOTTER NMOS NCR NOS

$5.89



[1pcs] 8520A-1 MOS 8520A-1  Commodore Amiga DIP40 USED picture

[1pcs] 8520A-1 MOS 8520A-1 Commodore Amiga DIP40 USED

$15.07



1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ picture

1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ

$317.00



1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Drive Main Board #CZ picture

1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Drive Main Board #CZ

$255.00







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