By clicking on the button "return" gives illegal state exception

Hello

In my app, when I'm clicking on I show a dialog box. and when I am pressing Yes in the dialog box, it gives me the illegal state exception. But I want to return to the previous screen. If I'm clicking on menu and then clicking Close, and then it goes back to the previous screen. Here is my code:

public boolean keyDown(int keycode, int time) {

        if (Keypad.KEY_ESCAPE == Keypad.key(keycode)) {
            int result = Dialog.ask(Dialog.D_YES_NO, "Do you want to edit the list?");
            if (result == Dialog.YES)
            {
                try
                {
                    UiApplication.getUiApplication().popScreen(this);
                }
                catch (Exception e)
                {
                    e.printStackTrace();
                }
//              onClose();
            }
            else
            {
                return true;
            }
        } // end if

        return false;
    }

Please help me...

Same question in StackOverFlow:

Dear arindamhit,

When you are clicking back into the device and then by default button the onclose() method is called. So try to do like this;

protected boolean onSavePrompt()
{
    return true;
}

public boolean onClose()
{
    int choose=Dialog.ask(Dialog.D_YES_NO, "Close the screen");
    if(choose==Dialog.YES)
    {
        return super.onClose();
    }
    return true;
}

It's the best way; If you use like the one above you might get a problem; It is:

*) If you use this method on the first screen, then according to your code when popup screen then there is no screen in the battery display (because it's the first screen); So you could get this kind of problem;

Try this one;

Tags: BlackBerry Developers

Similar Questions

  • Satellite P300-156 - and the button Return give the same values

    Hello

    I have a satellite P300-156, and it has a numeric keypad.
    I have problems because the Enter key and the Return key give the same values. I believe that it is incorrect.
    Can anyone help.

    Key on the numeric keypad should give an input it does.
    the Enter key on the main keyboard should give a carriage return value, but it gives an input value.

    Usually this does not cause a problem, but with software like photo shop that makes the distinction between a carriage return and a hard fall it does not work.

    Can someone help me please

    Thank you

    Hello

    To my eyes the entry and return keys are the same keys that provides the same functionality.
    I really put t know why you believe that there is something not right

    By the way; Check if you are using the latest version of the BIOS!

  • Blue contours appeared and I can't control my iphone 5 s. I can't go to settings. I triple click on the button "home" and gives a message to go into settings and enter the password but I can't get to the settings. What does not work? Thank you

    Blue contours appeared and I can't control my iphone 5 s. I can't go to settings. I triple click on the button "home" and gives a message to go into settings and enter the password but I can't get to the settings. What does not work? Thank you

    The blue plan is switch control.

    s http://gettecla.com/blogs/News/15538916-what-is-switch-control-mode-in-apples-IO

    Triple click to get rid of him.

    "Siri to the rescue.  I said turn off the control switch. »

    Re: How to disable the switch control

    I don't get a request for an access code.  What is a school system?

    switch control

    Settings > general > accessibility > switching control

    R

  • warning by email: we discovered the series of illegal attempts on your e-mail account of different areas of the intellectual property. It's for your own safety to continue to use your account, click on the button below.

    Original title:

    warning by email

    Got this e-mail with the subject attention!

    Is - is this legitimate?

    He wants me to press any key to continue

    Thank you

    Microsoft account
    Microsoft Security info
    We discovered the series of illegal attempts on your e-mail account of different areas of the intellectual property.
    It's for your own safety to continue to use your account, click on the button below.
    Continue
    Note: Please do not ignore this email to avoid your closed account
    Thank you
    The team Microsoft account

    Hello

    Phishing scam.
    Ignore!

    FYI

    Microsoft usually has a green shield on the name of the sender.

    This indicates that the e-mail coming from Microsoft / play the sender.

    If, in case of doubt, please check your email to see if the Green Shield is there. ***

    Phishing: Frequently asked questions
    How can I Report Spam, Phishing or abusive messages in Outlook.com?

    My account has been hacked

    How to recognize phishing e-mails, phone calls or links

  • How stop the overlap after having clicked on the button to return to the previous label?

    Hello!

    I am a novice and doing an interactive book of five pages with Flash CS5.5 and ActionScript 3.0. I use buttons to navigate through the pages.

    I attributed to each page as label1, label2, label3, label4, label5. Each label contains several clips (whose sounds.)

    When I click on the button to access the next label, everything works fine. But when I click on the button to return to the previous labels, all sounds begin to play at onece and overlap between them.

    I did a simple FLASH file as an example to explain what I mean.

    SAMPLE SOUND OVERLAPPING. FLV

    That's the problem I have right now.

    SWF FILE:

    http://DL.dropbox.com/u/11630261/Flash/sound%20Overlapping%20sample.swf


    Please help me! I searched the internet and books that I have, but still cannot find a solution to this

    Thanks for your time! And please excuse my English.

    If you have (or should), at most a single sound at any time, you can use:

    SoundMixer.stopAll ();

    before you begin each sound.

  • My computer does not work and comes up with message after I've click on the button for auto repair

    Hi my computer just stopped working when I turn it on it gives me the opition to repair or start normally once Ive clicked on the button for it to try to repair the computer which is recommended after a few hours, this message appears:

    Stop

    Unrecoverable system error

    Session manager failed to create patches pre protected

    System process stopped at unexpectably with a status of 0xc000003a

    System has been shut down

    Someone knows how can I get my computer working again please

    Thanks in advance

    Hi Charlenebaldwin,

    ·         Did you do changes on the computer before the show?

    ·         What version of the operating system is installed on the computer?

    ·         You are able to boot to the desktop or SafeMode?

    Follow these methods.

    Method 1: Disconnect all external devices except the keyboard and mouse.

    Method 2: Start your computer in last known good configurations.

    Using the last good known Configuration

    http://Windows.Microsoft.com/en-us/Windows7/using-last-known-good-configuration

    Method 3: Follow these steps:

    Step 1: Start the computer in safe mode and check if the problem persists.

    Start your computer in safe mode

    http://Windows.Microsoft.com/en-us/Windows7/start-your-computer-in-safe-mode

    Step 2: If the problem does not persist, perform a clean boot to see if there is a software conflict as the clean boot helps eliminate software conflicts.

    Note: After completing the steps in the clean boot troubleshooting, follow the link step 7 to return the computer to a Normal startupmode.

    Method 4: Run the Startup Repair tool and check if the problem persists.

    Startup Repair: frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows7/Startup-Repair-frequently-asked-questions

    Method 5: If the problem persists, perform a restore of the system recovery (winre) windows environment.

    What are the system recovery options in Windows 7?

    http://Windows.Microsoft.com/en-us/Windows7/what-are-the-system-recovery-options-in-Windows-7

  • My XP will not be stopped until I clicked on the button "Stop the computer" twice?

    I'm installing and uninstalling programs again.

    I click on the button "turn off". Nothing happens.

    Click again, and he obeys.
    I have most of the software companies insist on my computer needs to run their programs: NET, MySql, Visual Studio, Adobe, WinPcap, ffdshow and so on; and a dozen toolbars, etc. in the registry that I deleted the last months; like most of the guys. Your feedback is very much appreciated.

    Hi jediYL,

    Follow these methods.

    Method 1: Performs a search using the Microsoft safety scanner.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Method 2: Scan the file system (CFS) auditor to repair corrupted files.

    Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe)

    http://support.Microsoft.com/kb/310747

    Method 3: Perform a clean boot to see if there is a conflict of software like the clean boot helps eliminate software conflicts.

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Note: After completing the steps in the clean boot troubleshooting, follow the section How to configure Windows to use a Normal startup state of the link to return the computer to a Normal startupmode.

    After the clean boot used to resolve the problem, you can follow these steps to configure Windows XP to start normally.

    (a) click Start, run.

    (b) type msconfigand click OK.

    (c) the System Configuration Utility dialog box appears.

    (d) click the general tab, click Normal startup - load all services and device drivers and then click OK.

    (e) when you are prompted, click on restart to restart the computer.

    For reference:

    How to make a computer faster: 6 ways to speed up your PC

    http://www.Microsoft.com/atwork/maintenance/speed.aspx

  • Click on the button to see the ListField

    Hi all
    Please help... I don't know what the problem
    I have two problems.
    I have the screen where BasicEditField and ButtonField... If I click Show me so ListField.

    Here is my source code...

    package com.screen;
    
    import java.util.Vector;
    import com.stepan.kutaj.bbmsearch.util.CustomListField;
    import com.stepan.kutaj.bbmsearch.util.ListRander;
    import net.rim.device.api.system.Bitmap;
    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.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public class Test extends MainScreen
    {
        private BasicEditField enterSearch;
        private ButtonField btnSearch;
        private String txtMenuAbout = "About";
        private Vector info = new Vector();
        private CustomListField myListView;
        private String Name;
        private Bitmap displayPicture = Bitmap.getBitmapResource("rounded.png");;
    
        public Test()
        {
            super(MainScreen.VERTICAL_SCROLL | MainScreen.VERTICAL_SCROLLBAR);
    
            addMenuItem(_viewAboutMenu);
    
            this.getMainManager().setBackground(BackgroundFactory.createSolidBackground(0x00e5e5e5));
    
            Bitmap borderBitmap = Bitmap.getBitmapResource("rounded.png");
    
            VerticalFieldManager m = new VerticalFieldManager(MainScreen.NO_VERTICAL_SCROLL);
            m.setBorder(BorderFactory.createBitmapBorder(new XYEdges(12,12,12,12), borderBitmap));
    
            HorizontalFieldManager h = new HorizontalFieldManager(MainScreen.NO_VERTICAL_SCROLL);
    
            enterSearch = new BasicEditField("Search : ", "");
            btnSearch = new ButtonField("Search");
            btnSearch.setChangeListener(buttonListener);
            h.add(enterSearch);
    
            m.add(h);
            add(m);
            add(btnSearch);
    
        }
    
        public boolean onClose() {
            System.exit(0);
            return true;
        }
    
        private MenuItem _viewAboutMenu = new MenuItem(txtMenuAbout, 10, 20)
        {
           public void run()
           {
               UiApplication.getUiApplication().pushScreen(new AboutScreen());
           }
        };
    
        FieldChangeListener buttonListener = new FieldChangeListener()
        {
            public void fieldChanged(Field field, int context)
            {
                if (field == btnSearch)
                {
                    Bitmap borderBitmap = Bitmap.getBitmapResource("rounded.png");
                    VerticalFieldManager s = new VerticalFieldManager(MainScreen.NO_VERTICAL_SCROLL);
                    s.setBorder(BorderFactory.createBitmapBorder(new XYEdges(12,12,12,12), borderBitmap));
    
                        for(int in = 0; in < 4; in++)
                        {
                            Name = "Name" + in;
    
                            String listTitle = Name;
                            String listDesc = "Description: ";
                            String listDesc2 = "Desc: ";
    
                            info.addElement(new ListRander(displayPicture, listTitle, listDesc, listDesc2));
                        }
    
                    myListView = new CustomListField(info)
                    {
                        protected boolean trackwheelClick (int status, int time)
                        {
                            Dialog.alert(" Selected :" + Name);
                            return super.trackwheelClick(status, time);
                        }
                    };
    
                    s.add(myListView);
                    add(s);
                }
            }
        };
    }
    

    and my problem is when I click on the button that show me ListField and context menu... and I do not know how to disable the context menu open...

    second problem is:
    in this list I generated 4 rows with unique name

    for(int in = 0; in < 4; in++)
    {
    Name = "Name" + in;
    
    String listTitle = Name;
    String listDesc = "Description: ";
    String listDesc2 = "Desc: ";
    
    info.addElement(new ListRander(displayPicture, listTitle, listDesc, listDesc2));
    }
    

    and I want to click on line, so I have to show for this specific line name...

    myListView = new CustomListField(info)
    {
        protected boolean trackwheelClick (int status, int time)
        {
           Dialog.alert(" Selected :" + Name);
           return super.trackwheelClick(status, time);
        }
    };
    

    and I have problem of course that shows me all name lines generated only modified (for example name03).

    can you help me please?

    Thank you

    Stepan

    (1) change

    btnSearch = new ButtonField ("Search");

    TO

    btnSearch = new ButtonField ("Search", ButtonField.CONSUME_CLICK);

    (2) I would have thought that you want something like

    protected boolean trackwheelClick (int status, int time)
    {
    ListRander selectedLine = (ListRander0 (this.getSekectedIndex ()) info.elementAt;

    String name = selectedLine.getName ();

    Dialog.Alert ("Selected:" + name);
    Return super.trackwheelClick (status, time);
    }

  • Tip action to show only a previous button on a slide so the learner clicked on the button Submit on Drag and Drop

    I am a user of long date Captivate and have dabbled with advanced Actions and Variables, so know just enough to get me in trouble. Hoping someone can help me with what I hope is a simple tip action:

    I am currently using CP8 and created a training where learners click on a map of building to go to different "rooms" to complete an interaction drag-and - déposer a certain topic related HR. The problem is that some of my learners test forget what 'rooms' they have already read and will click on those they have already visited. I added a back button, so that they can return to the map if they made a mistake, but now they are able to leave the slide without completing the interaction drag and drop.

    Basically, I need to hide the back button unless the learner has already completed (for example, the user clicks on the button submit to) the Drag and Drop interaction, but I'm not sure how to set up. Can anyone help?

    Thank you!

    Hide the button back to begin with. A tip action can be triggered by an event the success and failure of the & slipped. I guess that you will need at least two commands:

    • View the "back" button
    • Go to the next slide.

    It seems the simplest solution. You can also ignore the slide D & D when they enter a second time, but then you will need a Boolean variable to be turned on/off by these same events and a conditional action on which checks this variable and immediately jumps to the next slide when it is set to 1.

  • animation continues to run through. I want that he stop on main menu, so I can click on the buttons

    animation continues to run through. I want that he stop on main menu, so I can click on the buttons that navigate to different scenes. Please help me I'm a noob.

    Here are screenshots of what I have in progress:

    Screen shot 2013-09-06 at 1.25.57 PM.png"Home" menu of the main time line

    Screen shot 2013-09-06 at 1.27.22 PM.pngscript in frame 1

    Screen shot 2013-09-06 at 1.27.57 PM.pngscript in frame 48

    Screen shot 2013-09-06 at 1.30.50 PM.pnganimation scene 2 shape tween who is not supposed to work at the long past the homepage. I want to animate but only after I click the button to do it.

    Screen shot 2013-09-06 at 1.30.58 PM.pngscript for this scene

    Screen shot 2013-09-06 at 1.31.12 PM.pngstage 3, which is causing all the issues I think? supposed to be able to drag the boxes. but it passes right through without stopping when I play.

    This is the compiler errors:

    Screen shot 2013-09-06 at 1.43.07 PM.png

    If you deleted the stop() of scene 2, that it will not stop there it will return to wherever is 'home '.

    If you intend to have the timeline stop on an image, then you must place a stop() command in this frame, or use a gotoAndStop() command.

    If you want to use the scenes be compatible with the way you write the goto command. Is rarely recommended use - instead, use the various sections of the chronology of a scene, or use some movieclips and control their visibility, or a combination of both.

    If you continue to have problems, try to simplify - build / add first navigation for a section at a time instead of trying to get all of a sudden.

  • Send the setting click on the button (panels)

    Hello world

    I'm currently trying to create a dockable panel on AE with ExtendScript, and I have a problem when I create the buttons.

    the thing is the number of buttons and their callbacks is not resolved and is sent to the script via a socket connected to a python interpreter.

    This part works well, according to what I have sent on the socket, AE creates buttons more or less.

    The problem comes when I have to click on the buttons. For now, I use this:

    function createUI(thisObj)
              {
                        myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "test panel", [100, 100, 300, 300]);
                        var panelstr = "myPanel.";
    
    
                        for(var i=0 ; i < commands_lenght ; i++)
                        {
                                  var cmd_name = commands_name[i].Name;
                                  cmd_name = cmd_name.replace(/\s+/g, '');
                                  cmd_name = cmd_name.split('.').join("");
                                  var cmd = panelstr.concat(cmd_name);
                                  button = eval(cmd);
    
    
                                  var posb = 5 + 25*i;
                                  var pose = posb + 20;
                                  button = myPanel.add("button", [0, posb, 100, pose], commands_name[i].Name);
                                  button.onClick = testclicked;
                        }
    
    
                        return myPanel;
              }
    
    
              function testclicked()
              {
                        alert("you clicked, well done! \nwant a medal?");
              }
    
    

    or is that what I would like to send a parameter to the function being called when (onClick)

    something like that:

    function createUI(thisObj)
              {
    
                                  button.onClick = testclicked(parameter);
              }
    
    
                        return myPanel;
              }
    
    
              function testclicked(parameter)
              {
                        alert("you clicked the" + parameter + " button, well done! \nwant a medal?");
              }
    
    

    and so far, it has not worked.

    so I wonder if it is still possible to do ^^'

    Thanks in advance for your answers

    Justin

    You cannot add an argument to a reminder.

    What are you trying to do exactly? The problem is that I do not understand what should be the variable 'parameter.

    If you need to use a specific variable within your callback you could just add to your variables button, I have not tried but it doesn't work?

    
    button1.onClick = testclicked();
    button1.myParameter = "first";
    
    button2.onClick = testclicked();
    button2.myParameter = "second";
    
    function testclicked()
    {
        alert("you clicked the " + this.myParameter + " button, well done! \nwant a medal?");
    }
    
  • Click on the button "display remote content" content remote does not show. If I go back to e-mail even later "display remote content" is not on the page.

    The "issue" essentially lines the problem.
    No distance shows content when the user clicks on the button "view remote content. Once it has been clicked on a specific email, if I go back to the same email, the button "display remote content" is not on the e-mail page and no remote content shows again in the body of the email.
    I use an updated version (24.4.0) of Thunderbird.

    The problem is often caused by anti programs anti-virus and other security software blocking Thunderbird to get the remote images. The GET for images using a web port usually and some security software not see Thunderbird as a browser and block access.

  • Can you is more middle - click on the buttons back and forward to open the most recent last/next page as a new tab?

    I use Firefox 26, and I remember at some point in the past you could middle - click on the buttons back and forward to open the most recent last/next page as a new tab. Now, it does not work. I have not changed anything else on Firefox I know works, so was it gradually as keyword.url or is this something else?

    ... OK, this is weird. I restarted Firefox in safe mode and the reworked for/back Middle-click, so I thought it was one of my modules. Yet once, I opened Firefox in normal mode... and Middle-click works.

    I have no idea.

  • When I open a Google search page and scroll down and click on the button "Next", things fail. With Safari, it's okay. Mac lion.

    A left click on the button 'Next', the screen go to pale (frosted, low text) and locking. But a right click on the button 'Next' and selecting 'Open in a new page' instead, works very well. You are using Safari normally on the same computer works fine.

    If you close Firefox, and then start Firefox in Mode without failure, in the problem? To start Safe Mode, go to help > restart with disabled modules.

    If the problem does not occur in Mode safe, then you can disable your extensions one by one until you find out that one is at the origin of the problem. See Troubleshooting extensions and themes and problems of hardware acceleration to resolve common Firefox problems.

  • How is it when I click on the buttons to exit, or the new tab open or any other button button are not repsond? I have to close the program down to get a new page.

    I can't get anything to respond when I click on the buttons. I can't go out the window, the back or forward buttons are unresponsive ect... I have to get out of the whole thins just to get a new page. I have uninstalled several times but it didn't seem to help.

    Hello

    Please check if this occurs in Safe Mode

    Extensions of the issues

    Troubleshooting Extensions and themes

    Uninstalling the modules

    Uninstalling toolbars

Maybe you are looking for

  • Can I play an All-region DVD on my MacBook Pro?

    Hello! I have a MacBook Pro (13-inch, mid-2012) and I am considering buying a DVD. However, the DVD is "All regions" (it's the Germany) and I played before only region 1 DVD on my MacBook (as I live in the United States). Before buying this DVD for $

  • Can I use the operator SIM card on my T530 wireless?

    I have a card slot SIM which is supposed to be for WWAN, but I do not have a WWAN modem. Can I use the SIM location in this State for WLAN (HSPA) and others (with Intel Centrino?), or do I have to buy a modem USB to a wireless carrier?

  • PCI\VEN_10EC

    Notebook for the wm 72 259 G replace drive hard reloaded windows 7 cannot use wireless device type: other devices Man: unknown Location: bus pci 2, device 0, function 0 the drivers for this device are not indtalle (code 28) device isn't using any res

  • NVIDIA 8800 GT graphics card failure

    I running Windows Vista 32 bit.  I got a quad core 2 processor and 3 GB of ram. The problem that I am facing is with my graphics card, an Nvidia Geforce 8800 GT. Windows Vista has been updated the software on my computer recently, and during this upd

  • Windows 7 can not find the network

    Hi guys I hope that someone can help me, I walked trough the forums but none of the above helped me. I also do not really understand some of them. But that's what happened. My internet was fine yesterday, I was watching some stuff on aliexpress when