1. YuGiOhJCJ's Avatar
    Hello,

    I have a test application with a screen containing a button.
    When I click the button (by pressing the trackpad key of my BlackBerry 9220), it opens a dialog.
    Then when I press the ESCAPE key of my BlackBerry 9220, it closes the dialog and I am back on my screen.

    Now, if I add to my screen a menu item, the behavior changes:
    When I click the button (by pressing the trackpad key of my BlackBerry 9220), it opens a dialog.
    Then when I press the ESCAPE key of my BlackBerry 9220, it closes the dialog and a popup screen menu is opened.

    So, I would like to add my menu item but keeping the old behavior of my application after closing the dialog.

    Any idea?

    Thank you.
    Best regards.

    Here is the code:
    Code:
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.MenuItem;
    import net.rim.device.api.util.StringProvider;
    public class TestApplication extends UiApplication
    {
    public TestApplication()
    {
    this.pushScreen(new TestScreen());
    }
    public static void main(String[] args)
    {
    TestApplication application = new TestApplication();
    application.enterEventDispatcher();
    }
    }
    final class TestScreen extends MainScreen implements FieldChangeListener
    {
    public TestScreen()
    {
    /*MenuItem myMenuItem = new MenuItem(new StringProvider("My menu item"), 0x230000, 0);*/
    ButtonField myButtonField = new ButtonField("My button field");
    myButtonField.setChangeListener(this);
    this.add(myButtonField);
    /*this.addMenuItem(myMenuItem);*/
    }
    public void fieldChanged(Field field, int context)
    {
    Dialog.alert("Test");
    }
    }
    Here are some screenshots:
    A popup screen menu is opened after closing the dialog-bb-1.png
    A popup screen menu is opened after closing the dialog-bb-2.png
    A popup screen menu is opened after closing the dialog-bb-3.png
    01-18-15 07:39 AM

Similar Threads

  1. Is the Z10 dead
    By a7madberry in forum BlackBerry Z10
    Replies: 74
    Last Post: 01-22-15, 02:11 PM
  2. Why am I unable to start my camera?
    By Rajat Sharma8 in forum BlackBerry 10 OS
    Replies: 3
    Last Post: 01-18-15, 10:41 AM
  3. Does the Google Play store for BlackBerry actually work?
    By Blackberry-Prince in forum BlackBerry 10 OS
    Replies: 6
    Last Post: 01-18-15, 08:20 AM
  4. Classic screen has gone dark please help!
    By ifreebird in forum BlackBerry Classic
    Replies: 5
    Last Post: 01-18-15, 08:05 AM
  5. 10.3.1 could possibly be coming out on the 27th of Jan
    By Amritv in forum General BlackBerry News, Discussion & Rumors
    Replies: 3
    Last Post: 01-18-15, 06:53 AM
LINK TO POST COPIED TO CLIPBOARD