Cannot navigate back to the previous screen (screen cannot be closed with the ESC key)

Hi all

I create simple BB app with eclipse jde 4.6.1, here the code example.

class myApplication extends UiApplication
{
    // applicatione entry point
    public static void main(String[] args)
    {
        // create an instance of our app
        myApplication theApp = new myApplication();
        // "run" the app
        theApp.enterEventDispatcher();
    }
    // app constructor
    public myApplication()
    {
     myScreen screen = new myScreen();
        pushScreen(screen);
    }
}

where my screen is like this

public class myScreen extends MainScreen implements ListFieldCallback {
private Vector menu;
private ListField menuList;
private MenuItem menuItem = new MenuItem("Details",100,10){
public void run(){
int index = menuList.getSelectedIndex();
if (index == 1){
Dialog.alert("list  "+index+" selected");
}
}
};
public void drawListRow(ListField listField, Graphics graphics, int index,
int y, int width) {
     ListField menulist = (ListField) listField;
     MenuRowManager rowManager = (MenuRowManager)menu.elementAt(index);
     rowManager.drawRow(graphics, 0, y, width, menulist.getRowHeight());
}

public myScreen(){
super(DEFAULT_MENU|DEFAULT_CLOSE);
setTitle(new LabelField("myScreen", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER));

this.addMenuItem(menuItem);
createListMenu();
}

public void createListMenu(){
menu = new Vector();
menuList = new ListField(){
protected boolean keyChar(char key, int status, int time){
if (key == Characters.ENTER){
// open next window
int index = getSelectedIndex();
switch (index){
case 0: //
break;
case 1: //
break;
case 2: //
break;
case 3: //
break;
default: // about
break;
}
}
return true;
}
};
menuList.setCallback(this);
menuList.setRowHeight(60);
menuList.setBackground(BackgroundFactory.createSolidBackground(Color.BLACK));

// first item
BitmapField mIcon = new BitmapField(Bitmap.getBitmapResource("image1.png"));
LabelField lblM = new LabelField ("First list item", DrawStyle.LEFT);
lblM.setFont(Font.getDefault().derive(Font.BOLD));
MenuRowManager menuM = new MenuRowManager();
menuM.add(mIcon);
menuM.add(lblM);
menu.addElement(menuM);

// 2nd item
BitmapField tIcon = new BitmapField(Bitmap.getBitmapResource("image2.png"));
LabelField lblT = new LabelField("Theater Near Me", DrawStyle.LEFT);
lblT.setFont(Font.getDefault().derive(Font.BOLD));
MenuRowManager menuT = new MenuRowManager();
menuT.add(tIcon);
menuT.add(lblT);
menu.addElement(menuT);

add(menuList);
}

}

and the definition of menuRowManager is like that

public class MenuRowManager extends Manager
{
    public MenuRowManager()
    {
        super(0);
    }

    // Causes the fields within this row manager to be layed out then
    // painted.
    public void drawRow(Graphics g, int x, int y, int width, int height)
    {
        // Arrange the cell fields within this row manager.
        layout(width, height);

        // Place this row manager within its enclosing list.
        setPosition(x, y);

        // Apply a translating/clipping transformation to the graphics
        // context so that this row paints in the right area.
        g.pushRegion(getExtent());

        // Paint this manager's controlled fields.
        subpaint(g);

        g.setColor(0x00CACACA);
        g.drawLine(0, 0, getPreferredWidth(), 0);
        //g.drawLine(10, 0, 10, getPreferredHeight());

        // Restore the graphics context.
        g.popContext();
    }

    // Arranges this manager's controlled fields from left to right within
    // the enclosing table's columns.
    protected void sublayout(int width, int height)
    {
        // set the size and position of each field.
        int fontHeight = Font.getDefault().getHeight();
        int preferredWidth = getPreferredWidth();

        // start with the Bitmap Field of menu icon
        Field field = getField(0);
        layoutChild(field, 48, 48);
        setPositionChild(field, 0, 6);

        // set the menu title label field
        field = getField(1);
        layoutChild(field, preferredWidth - 16, fontHeight+1);
        setPositionChild(field, 55, 30-fontHeight/2);

        setExtent(preferredWidth, getPreferredHeight());
    }

    // The preferred width of a row is defined by the list renderer.
    public int getPreferredWidth()
    {
        return Graphics.getScreenWidth();
    }

    // The preferred height of a row is the "row height" as defined in the
    // enclosing list.
    public int getPreferredHeight()
    {
        return 60;
    }
}

the problem is, when the first screen showed (pushed), I cannot "navigate back (close) the screen with ESC, won't my code?" Am I missing something here?

Thanks in advance

You want to substitute keyChar() into your custom domain.

Don't forget that you must re - delegate all keystrokes that you do not consume.

Tags: BlackBerry Developers

Similar Questions

  • Where is Windows Clipboard files? What directory? I was not able to find this information. I want to get back to a previous screen printing.

    Where is Windows Clipboard files? What directory? I was not able to find this information. I want to get back to a previous screen printing.
    I didn't not turn off my computer and I did 3 other print screens after that I want to get back because I didn't stick it in Paint by mistake.

    The clipboard objects are not stored in a file. When you send something to the Clipboard, it is stored in a memory location that is only available for the operating system.

    A web search will find 3 third-party programs that will allows to record multiple Clipboard entries. Research on '' programs Clipboard. '' Microsoft® Security MVP, 2004-2009

  • Avoid popping on-screen to display the ESC key

    How can I avoid the current screen to be jumped to display when the user presses the ESC key or back

    Thank you...

    Solved by substituting the onClose()...

    Thank you...

  • How do you get the ESC key to minimize the item full screen

    My ESC used to reduce to a minimum the item full screen and now it will not, how do I do to work again?

    Hello

     
    Thanks for posting your query in Microsoft Community. I understand the ESC key is not working to minimize full screen Windows such that it worked before, so let me help you with that.
     
    Please provide the following information so that we can get a clearer picture on the issue:
    1. check if you are able to open the Task Manager by pressing ctrl + SHIFT + ESC key. This will help us understand whether or not the ESC key works fine.
    2. what program you minimize using esc key?

    You can also consult the following shortcuts to minimize the window.

    a. Windows + M
    b. Windows + D
    c. If you maintain Windows and press down arrow , which also helps to minimize the window.
     
    Hope this information helps. Please get back to us if you need further assistance.
  • Exit full screen via the ESC key

    I've developed a Flash video player and I tried to implement a support full screen, but for some reason any in trying to get out through the escape key, it must be pressed twice to this register. It works fine if I use my button to exit full screen. Here's what I'm working with:


    http://sostv.com/fscreen/v.html?vid=sostv.com/FLV/flv2_donatosMozzarella.FLV


    And I use a headset button to activate my full screen output.

    Anyone know what I'm doing wrong / need to change?

    Thank you.



    Exit full screen without doubt 'cancels' the spread of the ESC key for the Key object...

    I'd be inclined to use the earpiece of the scene:
    http://livedocs.Adobe.com/Flash/9.0/main/00002151.html#wp474056

  • I try to install MSI 4.5 with the windowsXP-KB942288-v3 - x 86 .exe file. I get a lot of messages that Setup could not back up the registry key... 5. access is denied.

    MSI 4.5 installation problems

    I try to install MSI 4.5 with the windowsXP-KB942288-v3 - x 86 .exe file. I get a lot of messages that Setup could not back up the registry key... 5. access is denied.

    I get this for about 10 different registry keys. If I hit ignore whenever Setup ends, but he told me that he have not installed properly and windows may not work.
    Any body have ideas of how to do to solve this problem?
    Thank you

    I did some further research and came across this http://support.microsoft.com/kb/949377 while it is not the same update I tried to install it, the problem seemed similar. I tried Microsoft fix it at the bottom of the page and I tried again to install MSI 4.5. This time, it worked.

  • Slideshow of Bridge CS4 64 bit will not end with the ESC key

    I just installed CS4 64 bit on a new computer with Windows 7 64 bit. I did the update now bridge sees my 5 d MkII Canon CR2 files but when I enter slideshow... which I use a lot to quickly examine images, I can not finish the slide show with the normal key ESC shot... Which really kills the utility of the slide show. Suggestions to do this at work or in other ways to close the slide show? Now, the only option is to croll through all images in the folder in which point slide show closes.

    Although there is no such thing as the 64-bit CS4, CS4 32 bit should work fine on a 64-bit computer.

    That cannot be done new is average, it's perfect.  See if the ESC key works with other programs. This function should be controlled by the operating system.

  • my computer hp laptop shows "Press the ESC key for startup menu" how to fix it help me?

    HP pavilion g6 mobile app
    product number: LN207EA #ABV
    Serial number: [redacted for privacy].
    Tell me please solution.

    Press the ESC key. In the menu choose F2 System Diagnostics. Test your hard drive & memory.

  • None of my function keys (F1 - F12) works with the exception of the ESC key. They worked fine yesterday, but now they do not have. How can I fix this?

    None of my function keys (F1 - F12) works with the exception of the ESC key. They worked fine yesterday, but now they do not have.

    How can I fix this?

    I use the SHIFT + F7 work much and would really appreciate help in getting up and running.

    Thank you

    Check if you have an F LOCK key in the top right of your keyboard.

    If this is not the case, try a system restore:

    Restore point:

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-system-restore/

    Do Safe Mode system restore, if it is impossible to do in Normal Mode.

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.

    See you soon.

    Mick Murphy - Microsoft partner

  • Pop-up doesn't close when you press the ESC key

    I have a Help menu where clicking commandmenu element opens a Popup. This menu is common to all pages.
    Only in the login Popup page does not close when I press the ESC key. Once the connection remains of pages ESC key works.

    Here is my code for the menu popup and order

    < af:popup id = "helpPopup" contentDelivery = "lazyUncached" clientComponent = "true" >
    < af:panelWindow id = title = "#{soembean.helpTitle 'pw1'} ' modal = 'false' contentHeight = '500' contentWidth ="900"clientComponent ="true"resize = 'on'"
    stretchChildren = 'first' >
    < af:inlineFrame source = "#{viewScope.helpURL}" clientComponent = "true" id = "if1' shortDesc =" #{viewScope.helpURL} "sizing ="none"/ >".
    < / af:panelWindow >
    < / af:popup >


    < af:commandMenuItem id = text = "#{somebean.proceduralHelpLabel"procHelp"} ' shortDesc ="Procedural help""
    "rendered =" #{! sessionScope.SimulationMode} "action =" #{viewScope.help.procedureHelp} "partialSubmit ="true ".
    immediate = "true" / >


    Please give me? no idea what could be the cause or any other solution to close the pop-up window for all hours when I press Escape key?

    Hello

    is the update in the inlineFrame when you press ESC? If yes then this is probably why

    Frank

    PS: If you do not plan to access the JavaScript popup then having clientComponent = true set is a loss of client performance

  • Why can I not downloand the guided help to back up the registry keys?

    I have Windows XP with SP3 and Internet Explorer 7 on my gateway Media Center 11.  I tried to download the INTERACTIVE HELP to back up the registry in Windows XP and I got a message saying "it was not available.      Do you have a cure?   Thank you.

    Hello
    I suggest you to download from this link and check to see if the same problem happens:

    http://support.Microsoft.com/AW/322756

    Check if that helps.

  • Why should I get invited to back up the encryption keys

    Running Vista Ultimate today downloaded a program called "Win32 Image writer" in order to write an ISO on a USB key file.

    I was unable to "just run the utility" as stated in the note "readme", just kept flashing to a BACK window when you try to run it.

    Tried to remove the program, but was told repeatedly that it was in use.

    Since that time I keep getting warnings of dire consequences if I don't support up to my encryption key.

    Restarted my PC and then managed to 'Remove the shift' all partners/records, some of whom are green in the Explorer tree.

    I've learned since that denotes encrypted files!

    I never asked to be encrypted, and now they are gone I always tells me to save these keys.

    I see that I have no other files encrypted on my machine.

    Can someone help me get rid of this warning, or tell me how to check if my machine has all of the encrypted files?

    Thanks Anil, but your statement:-"There is a possibility that the encryption keys are not recognized by the files."

    Implies that I have some encrypted files!

    This is the point, I have never actively sought encryption of one of my files.

    Encrypted files, I saw in the Explorer (shown in green) have been created by a program called "Win32 Image writer", which I had downloaded in order to write a file ISO of Linux on a USB.

    Immediately this program has been installed these encrypted files appeared and started to the harassing!

    I have no idea why the program should act with such stealth, I suspect it was something bad!

    I was totally unable to launch the application and decided to remove it, but it has not been listed as being installed in Progs & features and since there is no "Uninstall" file, I was reduced to "Move/remove" program folder and subfolders encrypted.

    After the second reboot, I had no other please "backup encryption keys", and I see there is no other "green" article in the Explorer tree.

    I am pretty sure that I eradicated the problem, unless there is a way I can force the system to show me if there are other encrypted items.

  • Unexpected Windows 7 Pro Message on encryption of files, asking Me to back up the encryption key and password

    Have a desktop HP 590 t 2 - months old, Win 7 Pro 64-bit running.  Two days ago, I received an unexpected pop-up Windows message, saying something like "Files EFS in Windows."  When I click on it, I get 3 options:

    1 certificate of encryption and the emergency key and create the password
    2 ask me later
    3. do nothing... If you don't back up your key and the password, you will not be able to access the files.

    What is strange, is that I did nothing (that I know) which would cause no files to encrypt.  I don't know yet what it is, other than what I read in the help Windows.  I called HP Tech Support, they advised me to choose "REMIND ME LATER", that's what I selected.

    After that I turned the computer off yesterday morning, then turned it back last night, I had the same command prompt.  But he appeared at the start, then went off on his own.  I did have to choose anything.

    Since it is a new computer, I was installing software, but legitimate all software, such as Microsoft SQL Server 2008, Dreamweaver, etc..

    Here are my questions:

    1 - is Windows, or could some software I have installed, start encrypting files ON it's OWN?  I thought files could only be encrypted if I expressly and explicitly started encryption of files.

    2. is there a say if all the files on my computer are encrypted?

    3 is it normal that Windows prompts you on file encryption, after so many weeks or months of use?

    4. is there a way to get Windows to stop for prompting me on this subject?

    I read another post where someone said the same thing.  'Out of the blue", they got the same message, I did it.  There was no response to this post.  Appreciate any advice on what it means.  Thank you

    Ezgoin

    Thanks for the tips.  I think I may know what it is.  It could be the edition of SQL Server 2008 R2 Developer, I had installed recently.  Apparently, it encrypts certain files as part of its operation.  I read where it makes the encryption/decryption of files in real time.  I hope it's something 'internal' for SQL Server and will not affect anything else on my PC.  I use SQL Server 2000 on Windows XP for 10 years and has never seen this message.  Was only my PC Win7 64 bit for 2 months, so am always install software.

    If the OS Win7 can be noticed this and simply prompting me for a key.  I don't know if I should get just a key/password or not, just to be safe.

    But the message popped up when I used an option in a program to copy files to an external flash drive.  I checked, and none of the files on the flash drive, or in the folder root of the program on the desktop are encrypted.  So the time the message appeared might be a coincidence, as the copy of files from the flash drive.

    So far, everything works OK and have only seen the message once more, when I restarted Friday, then the message disappeared on its own.  Have not restarted since then but little time.

    If he continues to appear, will try your suggestion.  Thank you very much

    Ezgoin

    I never saw the message once more,

  • Laptop does not, shows "press the ESC key for startup menu?

    Hello

    I have a hp laptop Pavilion g6 (product QE05UA #ABA, model: g6-1c35dx)
    . For a while his summer of problems, it was slow, showing the virus, and now it won't start.

    I left it on the mode 'sleep' last night, once I opened it today, it has been disabled. I thought that he lost battery which usually doesn't happen, but I turned it on and it shows a flashing screen that comes on and then turns black, again and again. the flashing screen shows "press ESC key for startup menu.

    In addition, the caps lock key will blink once when that lights up the screen.
    When I press "esc" it says this:

    The F1 system information
    The F2 System Diagnostics
    F9 boot device options
    Bios F10 Setup
    F11 system recovery
    Enter - continue starting

    I tried all of them, including some tests in "BIOS".

    I don't know much about computers, and it is one that I need so help is greatly appreciated.

    Hello @Mike1994r ,

    Thank you for your reply,

    I see that you were able to run the tests and make a recovery but the problem persists, I suspect a hardware problem.  As you were unable to locate the problem of testing, I suggest contacting HP support for assistance.

    Please contact our technical support at 800-474-6836. If you do not live in the United States / Canada region, please click on the link below to get a number of assistance for your region.

    World wide phone holder

    Good luck!

  • Re: Broken of the ESC key

    Hi, I foolishly broke my ESC key during the cleaning process, on my P200-1EE.

    I have 2 intact white key retainers and high silver esc key. I tried to plant back on myself, but it's too complicated and I did not understand how they fit together.
    My mother took in a PC shop and they want £15 for 2 hours work on it. I thought it would take much less time, while. It's really that tricky or they cheat me.

    I could really do with Save £15 and try it myself, but I don't know where to start. Someone at - it really detailed guides on how to reinstall the key and restraints. I saw a couple but they describe how restraint systems fit together and what order.

    Someone at - it help him?

    Thank you

    Is just plastic cover removed or deleted you also small mechanism under the lid?

Maybe you are looking for

  • Measure calories burned when using drive

    Hello The question I have is will be your Apple Watch measure speed of combustion of different calories for the same distance at the same time, when to do using workout app as opposed to not use the app to drive? The reason for the question is that I

  • When I try to singning in I have the cloud but it show your id is blocked for security reasons also paswrd is correct Please unlock my icloud id

    My icloud id had been blocked when I apply the right password in my icloud id then display shows the error msg contain, your id has been blocked for security reasons "I forget my security questions help me kindliy inthi held. Thank you very much

  • Help of Smartphones blackBerry to sync with Palm Desktop

    Hello: I need help on how to synchronize or transfer all my files, calendar address etc... my Palm Desktop to my Blackberry 9000 "BOLD". I saw the switch device Wizard in the Office Manager, but when I clicked in there the option click in Palm is not

  • IOS AnyConnect hairpin

    Hi all! If I run into issues trying to get remote user AnyConnect to hairpin. So, we have servers that are on the Internet and allow only connections froms our public subnet HQ. I want to do is create a remote user come into HQ using AnyConnect and d

  • Subscription with Photoshop problem

    My subscription on ok... paid for everything and no problems reported.But photoshop won't open. Shows a message saying to renew the subscription.The creative cloud is updated as well PS.The internet connection works as well encrypted access.What shou