SeparaterField in ApplicationMenuItem?

Hello everyone,

How to add the separatorField in ApplicationMenuItem?

Thanks in advance.

There is no direct way. but you can try this:

ordinal values with a difference of more than 100,000 have separators between them

Source:
http://www.slashdev.ca/2008/05/07/MenuItem-Demystified/

Tags: BlackBerry Developers

Similar Questions

  • ApplicationMenuItem

    Hello!

    I try to put the message in the Blackberry message box and allow the user to open my application with a settings when he clicks to this message.

    But the my ApplicationMenuItem run() method is never called. When I click on the message, it launch the application through the ApplicationDescriptor used only to save the menu items. So I can't used the id of the message as an argument to launch my application

    This is the code, run on a 4.6.0 version:

    ApplicationMenuItem[] newGuiMenuItems = new ApplicationMenuItem[] {
    new MessageContextMenu(0) };
    
    ApplicationDescriptor descr = new ApplicationDescriptor(
        ApplicationDescriptor.currentApplicationDescriptor(),
        new String[] {"open_message" }
    );
    
    reg.registerMessageMenuItems(
            PushConstantes.MESSAGE_TYPE,
        PushConstantes.STATUS_NEW,
            newGuiMenuItems,
            descr
    );
    
    ////.........................//
    
    //Add a message to folderreg.getApplicationFolder(Folder_ID).fireElementAdded(MyMessage);
    

    I tried to put the ApplicationDescriptor false or failing, but it the same behavior or crash

    I did something wrong?

    Thanks for the tips

    Well, it is resolved,

    If everything has to deal with the issue. It should be like this:

    reg.registerMessageMenuItems(
            PushConstantes.MESSAGE_TYPE,
        PushConstantes.STATUS_NEW,
            newGuiMenuItems);
    

    Do not put a different ApplicationDescriptor of real demand (who, with him, was created) if we want the run() method of the ApplicationMenuItem to be called.

    It will be otherwise simply run the application passing the argument of the created ApplicationDescriptor ("open_message" in my example), without worrying about the ApplicationMenuItem, unless the real demand was killed before.

  • Browser OS 6 VS ApplicationMenuItem

    Hello

    We are working on a simple application that uses an ApplicationMenuItem added to the ApplicationMenuItemRepository to perform its functions. We have all this work, and in general it works fine.

    However, on a real device of the torch OS 6.0.0.246 version we are facing a problem. After that a web page has been rendered in the browser, our section suddenly stops working within the browser application. He still appears on the menu, but clicking on it does fire the event to our application. If you click on the MenuItem BEFORE actually visiting a webpage (ie. on the first list of recent addresses, etc.) it works.

    OS version 5 and 4.5 devices have been tested and their browsers fire the event.

    The menu event also works well to other applications on the device of the OS 6.

    Someone has an entry on it, or see a similar problem?

    Thank you

    Jason

    www.lcamobile.com

    Thanks for the code sample.  It looks like a problem when using MENUITEM_SYSTEM.  It does not correctly when you use MENUITEM_BROWSER.

    This issue is reflected in the Issue Tracker here: https://www.blackberry.com/jira/browse/JAVAAPI-1502

  • ToolBarMenuButton.AddMenuItem (ApplicationMenuItem) survey java.lang.Error

    ApplicationMenuItemRepository.getInstance () .addMenuItem (ApplicationMenuItemRepository.MENUITEM_SYSTEM, applicationmenuitem)

    It shows an error: "Eception exception: Java.lang.Error.

    The exception cannot be caught and does not appear in the debugger, only on the phone.  It happens once ToolBarMenuButton.AddMenuItem calls toString in the ApplicationMenuItem, but the chain is fine - a literal.

    The call stack is several levels deep within unknown methods.

    Works fine in simulators and on the storm, but not on a 8330 4.5 running.

    Solved.  For some reason you need PIM / permission to organizers to add the entire system menu items.  I got the module defined with this permission, but the CodeModuleGroup didn't.

    They did of course difficult to debug it - he didn't throw a ControlledAccessException as it was supposed to.  Instead, he threw something that cannot yet be intercepted, which means that if users don't have the right permissions, the bombs of the app with an error that could be anything.

    Checks permissions and prompting if necessary, but in the past have always had requests for assistance relating to permissions yet, so it does not always work.

  • JDE 4.2 + default ApplicationMenuItem

    Hello

    I join some menu items customized with the BB system menu. As follows:

    ApplicationMenuItemRepository.getInstance().addMenuItem(ApplicationMenuItemRepository.MENUITEM_EMAIL_EDIT ,this);
    

    It works well enough. My custom menu items appear in the menu.

    But anyone know anyway that I can get my custom menu items appear in the default short list of menu items that appears when the user presses the trackball?

    ApplicationMenuItems only appear in the menu, not the reduced.  Third-party applications are not able to add ApplicationMenuItems to the menu of built-in applications reduced.

  • HowTo send the browser to the background (ApplicationMenuItem)

    I have the following scenario:

    Application screen A, x

    --> called a browser with the URL session where an image is displayed

    works well

    Request A, x screen adds an ApplicationMenuItem in the browser

    to make it easy to open some other URL with other images

    Request A, x display also adds an ApplicationMenuItem in the browser,

    to return directly to the screen X application has

    It is uncomfortable if the user performs a work more in the browser-

    then he also has to use 'switch to the application' or hit the

    'return' of many times

    It works well to return to the Application, screen x

    but then if hit 'return' of the x screen it returns to the browser

    but of course, I want to return to the last screen to request A

    so my question: is it possible to move the browser in the background application

    and remove the battery from the screen?

    answered by myself ;-)

    inside the run() to my ApplicationMenuItem I added:

    ApplicationManager.getApplicationManager().runApplication(mainApplicationDescriptor);
    

    now the browser passed to my request, and the hiotting going back inside my app now works as expected.

    BTW: to get the handle of my app I used

    ApplicationDescriptor.currentApplicationDescriptor()
    
  • ApplicationMenuItem in position 10

    Hello

    I would like to insert a voice menu in the menu of the calendar, so I use this code

    Menu MyMenu = new MyMenu();
    ApplicationMenuItemRepository.getInstance () .addMenuItem (menu, ApplicationMenuItemRepository.MENUITEM_CALENDAR);

    MyMenu corresponding to this class

    SerializableAttribute public class MyMenu extends ApplicationMenuItem {}
    public MyMenu() {}
    Super (10);
    }
        
    public Object execute (object context) {}
    do something
    }

    public String toString() {}
    This is the label for our menu
    Return Constants.Menu.LABEL;
    }
    }

    The voice is not in position 10, but in the first... Can I know what is the problem?

    Thanks in advance.

    Kind regards

    Gianni.

    Each menu item set is an ordinal value. Some menu items may be iof 100 000 value or more. The lowest ordinal go upstairs.  This explains why your ios value '10' liquidation at the top of the menu.

    Try to make the ordinal value over 10 (such as 10,000, 20,000, etc.) and see what happens.

  • Custom ApplicationMenuItem that appear within all applications?

    I have an application that uses an ApplicationMenuItem to a new option on all the menus of the integrated application using ApplicationMenuItemRepository.MENUITEM_SYSTEM. Works very well.

    But I've noticed recently on a 8900 (OS 4.6.1.231) that my menu item appeared in the other menus as well, including internal menus inside my own application. I also discovered that what is happening on the storm Simulator as well.

    If something has changed in the newer operating systems on the use of ApplicationMenuItem? I want only the menu item on the applications of the system and especially not my own app!

    Thank you

    Nicholas

    This feature was introduced in version 4.7.0 BlackBerry terminal software.  The MENUITEM_SYSTEM flag now adds the ApplicationMenuItem to third-party applications as well.

    You could eliminate it from your application by substituting the makeMenu method and add only the menu items desired for the user to see.

  • ApplicationMenuItem called with null in JDE 4.6 when you enter the phone number

    When I install a custom phone app, ApplicationMenuItem and

    try to enter a number on the keypad of the native Dialer, and then click the custom menu,

    my custom ApplicationMenuItem is called with a null context object.

    This same code + test case works well under the 4.5 JDE / 8300 emulator

    and device 8320, but fails under JDE 4.6 with the BB 9000 emulator

    and device

    To reproduce the bug:

    * Build/launch of the attached test application

    * Send with previous key

    * Go to the native Dialer

    * Enter "123" on the keyboard of the phone

    * Click on the trackball

    * Choose Bug49 the context menu

    * It will appear a dialog box indicating "context has the null value - is this a bug?

    NOTE that if, rather than enter a number on the keypad of the phone with step 4.

    a call log is selected, then it works and a non-null context object is passed.

    Can I make it work?  If this is a known bug, are

    It no work around?

    import net.rim.blackberry.api.menuitem.ApplicationMenuItem;import net.rim.blackberry.api.menuitem.ApplicationMenuItemRepository;import net.rim.device.api.ui.UiApplication;import net.rim.device.api.ui.component.Dialog;import net.rim.device.api.ui.component.LabelField;import net.rim.device.api.ui.component.RichTextField;import net.rim.device.api.ui.container.MainScreen;
    
    public class Bug49 extends UiApplication { public Bug49()    {     super();      Bug49Screen screen = new Bug49Screen();       pushScreen(screen);       ApplicationMenuItemRepository amir = ApplicationMenuItemRepository.getInstance();     Bug49NativeMenu bug49NativeMenu = new Bug49NativeMenu(0);     amir.addMenuItem(ApplicationMenuItemRepository.MENUITEM_PHONE, bug49NativeMenu ); }
    
      public static void main(String[] args) {      Bug49 b49 = new Bug49();      b49.enterEventDispatcher();   }
    
       static class Bug49Screen extends MainScreen {     public Bug49Screen() {            super();          setTitle(new LabelField("Hello"));            add(new RichTextField("Hello"));      } }
    
      static class Bug49NativeMenu extends ApplicationMenuItem  {     public Bug49NativeMenu(int order) {           super(order);     }     public Object run(Object context) {           if (context == null) {                Dialog.alert("context is null -- is this a bug?");            }         else {                Dialog.alert("context not null");         }         return null;      }     public String toString() {            return "Bug 49";      } }}
    

    It is a problem in the version of BlackBerry device software 4.6.0.  It has been fixed in version 4.7.0.

  • Addition of ApplicationMenuItem to the Maps Application

    I am trying to add an ApplicationMenuItem to the Maps app on OS 4.2, using JDE 4.2.1.

    I use the addMenuItem() method in ApplicationMenuItemRepository:

    m_appMenuRepos.AddMenuItem (ApplicationMenuItemRepository.MENUITEM_MAPS, m_map);

    The m_map object is a subclass of ApplicationMenuItem. I use a similar code to add items to the calendar, Memo, task menu, etc. and all this work. Only on the application Maps, the menu item does not appear when you run the Maps app.

    The snippet above in a try/catch block, no exception is thrown.

    JDE 4.2.1 device 8320 w / 4.2.2.180, sim is 4.2.x (no matter what sim with the Maps app, I tried several).

    Please take a look at the developers knowledge base article below for an example on how to do this.

    How - to add an ApplicationMenuItem to BlackBerry Maps
    Article number: DB-00618

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800703/How_To _...

  • ApplicationMenuItem in the Inbox and BB Messenger only

    Hello

    Is it possible to add a menu item for only the Inbox and the BB Messenger? Please help thanks

    See:

    MENUITEM_MESSAGE_LIST

    In the javadocs (ApplicationMenuItemRepository)

     

  • Separator menu in ApplicationMenuItem?

    How the hell is someone puts a menu separator in a Menu of Application?

    I don't see no API for this?

    You can not.

    I think that the system will place separators in large jumps in the ordinal values.

    For example,.

    100000

    100100

    100200

    <--------------  system="" would="" put="" a="" break="">

    200000

    Don't take my word for it, I'm going from memory - you will have to test it.

  • Retrieve ID ApplicationMenuItem to remove it

    Hi all

    This is my first post and I am rather new to Blackberry Java development...

    so in my application:

    I have created custom menu and save it with the ID MENUITEM_SYSTEM, now, I have a problem creating the method to remove this custom menu.

    I read in a thread it takes to ensure the menuitem that you want to remove with removeMenuItem (id, menuitem) is same menuitem that was created before, then you must know the id of this menuitem, store it in the Runtime or Persistent Store...

    My question is, how do I retrieve this menuitem id I created before?

    is this the same value with that I get from menuitem.hashCode ()?

    and if can get somehow the menuitem id, how do I remove it? because the method is removeMenuItem (id, menuitem) and id here is MENUITEM_SYSTEM, should which method I use to do the job?

    I hope someone can help,

    Thanks in advance...

    and sorry for my bad English

    Yes I just found a way using Runtime store

    When you create, I registered the menuItem to the store with the unique ID Runtime,

    then, when I want to delete, simply call DURATION store with the registered ID before, and I get an object that is, the menuItem.

    then with the cast of the object like my menuItem class, I called remove (id, menuItemObject)... Voila, menuItem is deleted!

    So I'll just mark this as solved

    But thx for your explanation

    See you soon

  • ApplicationMenuItem &amp; Contact = &gt; ClassCastException

    Hello

    As a first step, the code:

    class Demo extends UiApplication
    {
      public static void main(String[] args) {
        boolean autostart = false;
        for (int i=0; i>> DemoMenuItem::run");
    
          Logger.debug("Context : " + context.getClass().getName());
          Logger.debug("Context : " + context.toString());
    
          BlackBerryContact c = (BlackBerryContact) context;
    
          Logger.debug("<<< DemoMenuItem::run");
    
          return context;
        }
      }
    }
    

    So, I have two entrances: from the address book and icon. It works very well.

    But, the built context crash!

    And I don't understand why. I used samples of the RIM, to write this!

    The output of the event log:

    guid:0xBD0F38F00219F634 time:2009/05/13 15:07:23.0 severity:Debug Infotype:String app:Demo data:>>>   DemoMenuItem::run
    
    guid:0xBD0F38F00219F634 time:2009/05/13 15:07:23.0 severity:Debug Info type:String app:Demo data:Context : net.rim.blackberry.api.pdap.ContactImpl
    
    guid:0xBD0F38F00219F634 time:2009/05/13 15:07:23.0 severity:Debug Info type:String app:Demo data:Context : net.rim.blackberry.api.pdap.ContactImpl@7db7adad
    
    guid:0x9C3CD62E3320B498 time:2009/05/13 15:07:23.0 severity:Severe Error type:Exception app:Java data:tion data:
          ClassCastException
          No detail message
          Demo
           Demo$DemoMenuItem
           run
           0x1A5
          net_rim_bbapi_menuitem
           SdkProxyVerb
           invoke
           0x844
          net_rim_bb_framework_api-3
           ModelScreen
           invokeVerb
           0x65B
          net_rim_bb_addressbook_app-1
           ViewAddressCardScreen
           invokeVerb
           0x7C0B
          net_rim_bb_framework_api-2
           VerbMenuItem
           run
           0x7617
          net_rim_cldc-11
           Menu
           show
           0xA492
          net_rim_bb_framework_api-2
           SystemEnabledMenu
           show
           0x50AF
          net_rim_cldc-9
           Screen
           onMenu
           0x760F
          net_rim_cldc-9
           Screen
           keyCharUnhandled
           0x7339
          net_rim_cldc-13
           MainScreen
           keyCharUnhandled
           0x7721
          net_rim_cldc-9
           Screen
           dispatchKeyEvent
           0x6151
          net_rim_bb_framework_api-1
           AppsMainScreen
           dispatchKeyEvent
           0x2945
          net_rim_cldc-9
           Screen
           processKeyEvent
           0x8B73
          net_rim_cldc-10
           UiEngineImpl
           processMessage
           0x916C
          net_rim_cldc-6
           Application
           processNextMessage
           0x2207
          net_rim_cldc-7
           ModalEventThread
           run
           0x5B2C
    
    guid:0xDAA64EAD4E49C5D5 time:2009/05/13 15:07:28.0 severity:Always Logtype:String app:net.rim.usb.pwd data  :CbCn
    

    Where is my problem? and could you give me a solution?

    Thank you to

    Nicolas

    Hello

    I found my problem...

    I wrote:

    import net.rim.blackberry.api.pim.*;
    

    Instead of:

    import net.rim.blackberry.api.pdap.*;
    

    Sorry...

    Moreover, it is a hidden class 'net.rim.blackberry.api.pim '?

    I think that I found in your samples... but I can't remember where!

    Kind regards

    Nicolas

  • Applicationmenuitem location

    Hi all

    I need to add a menu item in the Inbox and it must be visible in the list of messages (ApplicationMenuItemRepository.MENUITEM_MESSAGE_LIST) and the email list (ApplicationMenuItemRepository.MENUITEM_EMAIL_VIEW) and email change the view (ApplicationMenuItemRepository.MENUITEM_EMAIL_EDIT).

    I tried the following,

    static long locationToAddMenuItem = ApplicationMenuItemRepository.MENUITEM_EMAIL_EDIT|ApplicationMenuItemRepository.MENUITEM_EMAIL_VIEW;
    

    It does not work. Please could you guys tell me how to add to the three places I mentioned. ?

    Thank you

    create a

Maybe you are looking for