09-16-2008 03:37 AM
09-16-2008 04:40 AM
Have you looked anywhere for the solution yourself?
I recommend searching in at least these three places, before asking a question on the forum:
a) Developer Guide - If you look in the Creating user interfaces chapter you will find a section conveneiently called
Adding menu items to BlackBerry Java Applications
b) This forum - using the keyword "ApplicationMenuItem" you will find a few interesting Threads
c) The KB - see the link to it from here:
http://na.blackberry.com/eng/developers/support/
I'm sure, amongst this lot you will be able to answer this question, and hopefully your next few as well!
09-16-2008 05:02 AM
Ha...i have found few interesting Threads. If everything does not function, unfortunately.
I would like to add in the Menu simply Item and use it then. If I provide Item and it adds I must use there always the given Ids?
For Example:
ApplicationMenuItemRepository.getInstance().addMen
uItem(ApplicationMenuItemRepository.MENUITEM_EMAIL _VIEW,this);
Take a look at my code:
//Constructor other class (new MyMenuItem(0)).registerInstance(); //Inner class class MyMenuItem extends ApplicationMenuItem { //using the default constructors here. public MyMenuItem(int order) { super(order); } // Register the instance of the menuItem with the system public void registerInstance() { //System.out.println("Registering MyMenuItemDemo"); ApplicationMenuItemRepository.getInstance().addMen
uItem(ApplicationMenuItemRepository.MENUITEM_EMAIL _VIEW,this); } //methods we must implement //Run is called when the menuItem is invoked public Object run(Object context) { //context object should be a email message if (context instanceof Message) { Message message = (Message)context; //this is where we would work the message //do something here } return context; } //toString should return the string we want to //use as the lable of the menuItem public String toString() { return "MyMenu Name"; }
09-16-2008 01:23 PM
joschika77 wrote:I would like to add in the Menu simply Item and use it then. If I provide Item and it adds I must use there always the given Ids?
I'm not sure what you are asking here. Can you elaborate?
09-17-2008 02:34 AM
I want to build my own menu with own items.As far as I understand the documentation I have to use standard items. Can't I make my own? What's the meaning of the ids? For example: I don't want to use "MENUITEM_EMAIL_VIEW" - I want to use "MENUITEM_MY_OWN".
The source code I posted before compiled and ran but there was no "EMAIL_VIEW" in the menu.
09-17-2008 11:37 AM
ApplicationMenuItem is used to add menu items to the BlackBerry applications that come on a BlackBerry handheld.
MenuItem is used to add menu items to your own application.
Where are you trying to add your menu?
09-24-2008 02:49 AM