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: 128
Registered: ‎11-05-2009
My Device: 9700
Accepted Solution

how to delete <Empty Menu> when click on menu button?

Hi

  In my application makeMenu() method, i am using menu.deleteAll() to delete all the default menus. If i run this code in 9530 (storm simulator) it shows onyl show keyboard and switch application menu, that is fine.

 

But if i run the code in other simulators it is showing <Empty Menu>. 

 

Where focus is any where in the screen it shows the empty menu when i click on the menu button.I need to remove this <Empty Menu> also.

 

What i want is If i click on the menu button, it should not show anything( means it should not show <Empty Menu> , but in the storm if i click the menu button it has to show (Show keyboard and switch application). 

 

Is there is anyway to solve this...?

 

Thanks

mindus

Developer
Posts: 16,503
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: how to delete <Empty Menu> when click on menu button?

overwrite onMenu and return true.

----------------------------------------------------------
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: 128
Registered: ‎11-05-2009
My Device: 9700

Re: how to delete <Empty Menu> when click on menu button?

Hi

  Thanks for your reply.

 

But i need menu (showkeyboard/hidekeyboard, switch application ) in storm devices. If i make it onMenu and return true, it wont dispaly any thing in the storm device,

 

I want to display this menu (keyboard/switch application) in storm simulator , and other simulator i need to remove <Empty Menu>.

 

 

Thanks

 

 

 

Developer
Posts: 128
Registered: ‎11-05-2009
My Device: 9700

Re: how to delete <Empty Menu> when click on menu button?

Hi

 

 Any more infomation about this issue...

 

 

Developer
Posts: 81
Registered: ‎01-28-2009
My Device: Not Specified

Re: how to delete <Empty Menu> when click on menu button?

hello,

 

Override

 

To delete empty menu override

 

public boolean keyDown(int keycode, int time) {    
    if(keycode == 268566528){      //key code of menu button

         return true;

    }

}

 

this wont display menu at all if you want menu  override

 

protected void makeMenu(Menu menu, int instance){

}

 

delete the menu you dont want..  and your own.. if you want default menu do nothing..

 

 

 

 

If you got the solution mark thread as solved nad give kudos to author whose solutoin you accept

Don't forget to mark your post as solved if you got answer. And give kudos.
Developer
Posts: 128
Registered: ‎11-05-2009
My Device: 9700

Re: how to delete <Empty Menu> when click on menu button?

Hi sachin_r

   Thanks for your reply.

 

I tried this below code what u given

 

public boolean keyDown(int keycode, int time) {    
    if(keycode == 268566528){      //key code of menu button

         return true;

    }

}

 

The problem is it will disable entire menu in all simulators.

 

But i need to show (switch application and Show/Hide keyboard) menu in 9530 and 9500 simulators.

 

In other simulator its fine for me ( to disable entire menu).

 

Any idea about this???

 

Thanks

mindus

Developer
Posts: 128
Registered: ‎11-05-2009
My Device: 9700

Re: how to delete <Empty Menu> when click on menu button?

Hi

  Any other info about this issue?

 

 is there is any way to do this.

 

 

BlackBerry Development Advisor
Posts: 14,954
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: how to delete <Empty Menu> when click on menu button?

You could use the DeviceInfo class to determine the BlackBerry model number and then return false in your keyDown method.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker