Global dialogue - show when the application is in the background

I have a function that opens a dialog for the user and the user must choose one of two options. The thing is, this function can be called when the user press a certain button, or when the application is in the background. So, to do this, I use the following code:

synchronized(Application.getEventLock()){
            final Dialog d = new Dialog(Dialog.D_YES_NO, msg,
                    Dialog.NO, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Manager.VERTICAL_SCROLL);
            // So I would identify it as a Dialog
            if ( Application.isEventDispatchThread() ) {
                // We have the Event Thread, can just show the Dialog
                UiApplication.getUiApplication().pushModalScreen(d);
            } else {
                // running in background
                UiApplication.getUiApplication().invokeAndWait(new Runnable() {
                public void run() {
                    NotificationsManager.triggerImmediateEvent(ID, 0, null, null);
                    UiApplication.getUiApplication().pushGlobalScreen(d, 1, UiEngine.GLOBAL_MODAL);
                    NotificationsManager.cancelImmediateEvent(ID, 0, null, null);
                    }
                });
            }
            return ( d.getSelectedValue() == Dialog.YES );
        }

It works very well when the user presses the button that calls this function. However, when the function is called when the application is in the background, nothing happens.

If you tap on the icon of the app again, it doensn can't have launched, the debugger says the application application forground and if he says so it is already running and doesn't anything. If the application crashes and you can't access.

How can I solve this problem and make the pop up dialog box to the user evern if the application is not to the point?

Thank you for your time.

I had problems with invokeAndWait() gel all that precedes. Unless you really need, I would use invokeLater().

Tags: BlackBerry Developers

Similar Questions

  • When I turn on my iPhone 6 screen shows only the background color, the icon usage and the reception icon.

    When I turn on my iPhone 6 screen shows only the background color, the icon usage and the reception icon.

    The iPhone's battery is fully charged?  Otherwise, load it, and then try again.

    If it is busy, go in recovery mode as explained here.  You may need to try to get into the mode of recovery once more to succeed.

    If you are unable to update or restore your iPhone, iPad or iPod touch - Apple supports

  • There are two screens (split screen) showing when the computer is turned on.

    There are two screens (split screen) showing when the computer is turned on. How can I delete one side to return to a view?

    Hi Ikthomas1,

    When did you start in this topic? Were there recent changes to the computer like installing new hardware, software or updates? If it is a recent issue, follow the steps in this document to perform a System Restore. This will restore your comuter up to a point located before the show.

    If you have antivirus software installed, run a scan of filling. You can also use Microsoft Security Essentials to scan your computer.

  • Why don't the LOCKING of upper CASE indicator showing when the button?

    Why don't the LOCKING of upper CASE indicator showing when the button?

    A CapsLock indicator should be part of installation Win7 OS normal and here's why.  I use a brand new Microsoft Wireless Keyboard 2000 s/n 0356100416937.  I can send you a photo or the retail sales receipt if you doubt this statement.  It is there no CapsLock indicator on the keyboard itself, probably to extend the life of the battery.  I also use an IOGEAR KVM switch to facilitate the transition between multiple computers.  Emule KVM switch a keyboard of 102 standard keys, so even if I load the last Ko-driver (MS Intellitype 8.2) the pilot reports Microsoft keyboard not detected.  Therefore, there is no way to determine when the CapsLock key is active.  If you have ever tried to enter a long password upper-lower case with the CapsLock key in the wrong state, so you can imagine my frustration with this keyboard.

    So, how do you display CapsLock indicator?

    REMOTELY, HP TECHNICAL SUPPORT TOOK ME AND MY 520TOUCHSMART AS I HAD AN INDICATOR OF CAPS LOCK ON MY SCREEN, NOW HE IS GONE. I GAVE THEM MY MS OFFICE2010 CELA: NOW I FOUND SOMETHING ELSE. I LACK WILLINGNESS TO CONTACT OF COURSE FRIDAY. IF I FIND A SIMPLE SOLUTION TO MY PROBLEM, I'LL POST IT. SOMEONE HAS AN IDEA?

  • Report do not show when the page is refreshing

    Hello

    I have a report of patient privacy and I have a column in the report at the end of TREATMENT DETAILS. When I click on DETAILS of TREATMENT and then move page command no 2. This page show me last visit treatment details report in a region and here I use the second area I add the current processing status. There is point four

    Checkbox name 1-disease
    2 - symptoms name box
    Checkbox name of 3 treatments
    medicine-4 Select name
    My first query of the region is
    select A.P_NO,A.P_NAME,B.DISEASE,B.SYMPTOMS, B.VISITING_DATE,B.TRET_NAME,B.MED_NAME,B.MED_COUNT FROM PATIENT_DETAILS A, PATIENT_SYMPTOMS B WHERE A.P_NO=B.P_NO AND A.P_NO =:REQUEST
    using these four point I fill in the details of current patient treatment and resend medicine by using select list but if he is NOT as medicine of Disprine salt; ECT list then add new drug I create a link when I click on this link then control will again page-3 and add new drug .but after submitting the new medicine and click on the "BACK" button then control access page - 2 and the treatment of the patients first region report do not show.

    I want to show this report when I click the back button on the page of no - 3.

    How can I do this...

    Thank you

    Published by: Ed on April 30, 2010 04:57

    Published by: Ed on April 30, 2010 04:58

    Published by: Ed on April 30, 2010 05:48

    Hi Maury,

    I changed your application and it's working now. The problem is, you set the number of patients at the request of page No - 7 when the link in the page no-6 is clicked. When you get back from page no-5 after the addition of medicine, demand comes from page no - 5 and it doesn't have the patient not inside, so the report query returns all the data.

    I added an item hidden in page 7 and I am the focus with the patient No. 6 and used page in the report query. The value of this element will not change until you change it or the session expires or you click on the link in the page no-6 for another patient. Hope this helps :)

    Thank you
    Machaan

  • Have a dialog box showing when the page is to submit.

    Hello

    I am developing an application that downloads an excel spreadsheet records and I have the basic functionality of this work. The problem is when the user clicks on the button transfer the application runs in the background and may take awhile to download records. What I want to do is when the user clicks this button I would a dialogue to say download or something and that its download finished files the dialog disappears and directs the user to the next page.

    I'm sure I've seen an example of this somewhere but I'm not having any joy trying to find.

    Forge, should I use Ajax or use jQuery to achieve?

    Thank you
    Paul.

    Hi Paul,.

    You can get this feature. I put an example of apex.oracle.com which you can take a look at Application is called app download - 29208. On page 1 if you press submit, you will see the icon flash on the screen treatment. You will need to download the gile processing3.gif from shared images, if you want to use in your application.

    EDIDEV workspace
    USER username
    password jadohi

    Concerning

    Paul

  • The language bar shows when the user account control appears, supposed to be hidden.

    I've been looking for an answer to this one so vain if this question has already been answered please point me in the right direction. I chose to hide the language bar after a reinstall of windows 7, but whenever the user account control appears I see the language bar sitting there, mocking me. I don't see any option to close, only to hide. It does not show during normal activity, only when the user account control POPs asking if I want to allow a program to run. It's driving me crazy.

    Thanks in advance

    Old post I know but I cannot believe no one could help you guys, I recently noticed this was happening on my pc, have no idea why, but I guess it was something to do with installation/un-installing new software. In any case, here is the solution, because I don't think that these guys have a clue of what you're going on, of course, lol.

    Click on:

    Beginning
    Control Panel
    Clock, language and region
    Regional and Language Options
    Keyboards and languages
    Change keyboards...
    Language bar
    Hidden
    Ok

    Now return to the regional and language options and then click:

    Administrative
    Copy to reserved accounts

    * Type password *, click on:

    System accounts
    Ok
    Ok

    If for any reason any you do not see a password for copy to reserved accounts, and instead, option you have this pop up with checkboxes:

    Copy your regional and language settings to these accounts:

    Default user account (new users)
    System accounts (local system, local service, and network service)
    Just check the two of them and ok.

    There's no more annoying language on UAC bar more.

  • Captivate 8 - quiz - keep the button appears when quiz is incorrect; only meant to show when the minimum answers are correct.

    I have a quiz 8 Captivate, I have been struggling with - having several questions, but I'll deal with this one first.  Right now, it's the button continue.  It is supposed to only appear when the answers of the quiz are correct (70% to 'continue').  When the answers below the minimum of 70%, the Retake Quiz button, makes however the continue button.  Is there a solution for this?  BTW, the is my button, a smart shape, I did and use it as a button to continue.

    The standard button to continue on the Quiz results slide appears always right from the beginning of this slide.  You cannot see towards the end of the time, or show/hide with advanced Actions.  One option that you have is hide it under one of the other buttons (for example the quiz recovery button).  Simply place this right on top of the button continue.  Then the learner can not see until they have passed the quiz or exhausted their attempts.

  • How to have the filter query/dialogue opened when the report is launched in the workspace?

    Is it possible to have a default value for the report to prompt the user for a value of filter/query when the report is opened in the workspace? Currently, when a report is released, it will display data from the previous report instance.

    Not really.

    You could put a limit/filter on the query Section and then change to limit/filter Variable.

    You want to add the following code in the Scripts of the bqy

    "" "ActiveDocument.Sections ["Query"]." Process()

    where the query is the name of the Section application to deal with.

    When the file is opened, you should get the limit/filter dialog box and when the value is supplied the query will run and update the data for you

    hope this is what you need to do

    Wayne

  • Possible to prevent the mobile site to show when the Office?

    I am building a website for one of my clients and it has a different design between the mobile and desktop versions. The mobile version uses different pages, and the desktop version is a design of a page. The problem I have right now is that I don't know if I can limit or prevent the Web site layout to change when I resize the width of the browser. I like to keep the desktop version of the Web site, even if the browser is resized. Before the sensitive update, it was possible to create three 'version' of the same site, and once the site is responsible for a mobile device, did not (unless you add a link) to load the desktop version and vice versa. Now, with how can the sensitive update, I avoid the desktop version to upgrade to the mobile version when the browser is resized? Any idea?

    Thank you!

    You need not use all or part of the breakpoints in this version of office. Just keep at least big enough set Property Page .

  • Lock my PC on the network, the programs still show in the background.

    normally, when you press ctrl alt del enter, your PC is locked and shows just the wallpaper and the security box telling you its coastline.

    When I lock a PC it shows all programs, I still running. Help!

    Hello

    Please try to verify that you have the software the latest video card drivers.  In addition, if necessary; try again to uninstall and reinstall video card.

    -Create an another user account and check if you still experience this issue.

    -Cleanboot Windows in efforts to isolate 3rd party interference.

    Thank you

    Aaron
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • New monitor P2414H and right color when the background is black

    Hello

    I bought Dell P2414H today and it's really a nice monitor. After the installation when I boot computer first time I noticed that the yellowish color of the line when the display is black. The other background is black or during startup if black color appears.

    It controls fault or something else?  Outside the black I don't see the same thing.

    Here, I have attached video clearly what I mean.

    cs_setInnerHtml ('video_e62aab42-8730-49 8-ad4e-436defbc57ad d', ");

    Thank you

    * Download Exchange monitor. Back to top of this monitor Forum
    * Open, "My 24" or more small monitor doesn't have a Service tag.

  • HP Pavilion dv7-3170ez: volume indicator not showing when the volume control

    Hello

    I own a Pavilion dv7-3170ez and when I change the volume using the slider button in the volume on top of the keyboard, the volume is adjusted accordingly, but no volume indicator appears on the display.

    Previously, when you adjust the volume, a speaker icon with a cursor jumped in the middle of the screen showing the current volume level.

    I use Windows 7 Home Premium and Windows Update and HP update shows that I have the latest version of the software. Also, I have the latest version of the BIOS installed.

    Note: the touch buttons on top (volume, speaker and enable wireless, etc) stopped working a few days after the disappearance of the sound meter, I have fixed that by connecting battery power and disconnectiong for awhile. However, the indicator is still not displayed. Don't know if this is related (I guess not).

    Thank you

    The Volume OSD is a HP MediaSmart Menu function. He has to load at startup. To do this, go to msconfig and make sure that it is enabled under the Startup tab...

    If she is not there, you can download it here... ftp://ftp.HP.com/pub/SoftPaq/sp48501-49000/sp48552.exe

  • Can not get the bookmarks menu to show when the lance of the browser

    When I launched Firefox browser this AM, the Favorites menu does not appear at the top of the screen to its normal place.

    Hi bmerella, the menus and toolbars are hidden in view full screen. You can leave this mode or using the context menu or by pressing the F11 function key.

  • View submenu items and stay showed when the menu item is selected

    The documentation is not clear with my question and some videos are not up-to-date.

    Let's say I have 3 menu items, A, B, C with 2 elements submenu under B (B-1 and B-2). When I mouse over B, I see 2 submenu items. When I click on B and select the B-1 or B - 2 submenu item, the corresponding page is displayed but I wish that the submenu to stay visible until I select another menu as A or C. How can I do? Thank you.

    This is the default behavior, you must customize this or you can use compositions for the creation of menu where hide none can be configured for the target container.

    Thank you

    Sanjit

Maybe you are looking for

  • Firefox always opens with «well, it's embarrassing...» "not with the settings window & tab my most recent. How can I fix it?

    I entered the different settings for my homepage, opening window etc, but each opens Firefox of time he is stuck on the same problem and asks if it should restore it or start new Session, never put into service with my new options. thx for any info

  • How to use the bootable on my Satellite C50D-A new CD

    HelloI just bought a toshiba satellite C50D A 138and I wanted to change the version of windows. I changed the bios settings to boot with cdrom, but it does not start on the cd.I'm sure that the cd is bootable, because I tested it on another PC How a

  • How can I fix my dvd player so it will play the DVD

    I ordered a new DVD player on amazon, he came straight from China. Now it will not read the dvd. and there is no region tab change the region in the dvd drive properties. Windows Media Player cannot play the DVD because the disc prohibits playback in

  • Cannot print document on Samsung Galaxy S5

    I have an IPad and you are unable to print a document from my IPad directly on my printer HP Photosmart 6520. My wife has an identical printer so I can choose one or the other. I just bought a new cell phone Samsung Galaxy S5 and received an email wi

  • Windows 7 is not genuine message.

    Like many others, I received the same message "Windows 7 not" authentic. I bought my computer with Win 7 pre loaded, at least 2 years. I checked through other messages by the resolutions seem to be different. I have a diagnostic report I posted below