How to close the pop-up screen with timer

Hello

How to close pop-up display with timer .assuming I want to close pop-up screen after 10 seconds please share code me complete.

Hello

See this sample program,

import java.util.Timer;
import java.util.TimerTask;

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.PopupScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;

public class Example extends UiApplication {
    public static void main(String[] args) {
        Example app = new Example();
        app.enterEventDispatcher();
    }

    public Example() {
        pushScreen(new ExampleScreen());
    }

    private class ExampleScreen extends MainScreen {
        public ExampleScreen() {

            ButtonField but = new ButtonField("Click",ButtonField.CONSUME_CLICK);
            but.setChangeListener(new FieldChangeListener() {

                public void fieldChanged(Field field, int context)
                {
                    UiApplication.getUiApplication().pushScreen(new exmplePopup());

                }
            });

            add(but);
        }
    }

    private class exmplePopup extends PopupScreen
    {

        public exmplePopup()
        {
            super(new VerticalFieldManager());
            GuestPop p=new GuestPop();
            add(p);
        }

        public class GuestPop extends VerticalFieldManager
        {
            public GuestPop()
            {
                add(new LabelField("Hi How r u"));

                Timer timer  = new Timer();
                 timer.schedule(new CountDown(), 5000);
            }

        }

        private class CountDown extends TimerTask {
            public void run() {
                UiApplication.getUiApplication().invokeLater(new Runnable() {

                    public void run() {
                        UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());

                    }
                });

            }
        }

    }
}

Here, I've given 5 seconds.

Thank you.

Tags: BlackBerry Developers

Similar Questions

  • How to get the orientation angle screen with 40 Hz stably without delay to sync?

    Goal: Get orientation angle screen at 40 Hz stably without delay for synchronization.

    Problem with two situations:

    1. When you use the bbutil_swap and navigator_event_get_orientation_angle (event) to get the orientation angle screen with other data such as acceleration sensors and gyroscope data, the sampling frequency will be low grade at 10 Hz randomly. The difference of synchronization will increase from 25 ms to 100 ms.

    2. when the screen orientation angle is collected in the following code to get the angle only, the difference in timing of sampling will be 1, 2 or 5 seconds at random.

    Question: How do I get the orientation angle screen with 40 Hz stably without delay to sync?

    or something wrong in my code?

    Mini code:

    public static void handleNavigatorEvent(bps_event_t *event) {}
    switch (bps_event_get_code (event)) {}
    case NAVIGATOR_ORIENTATION_CHECK:
    navigator_orientation_check_response (event, true); If not the line, no updates on the screen rotation.
    angle = navigator_event_get_orientation_angle (event);
    break;
    case NAVIGATOR_EXIT:
    stop = true;
    break;
    }
    }

    public static void handle_events() {}
    for(; ) {
    bps_event_t * event = NULL;
    If (BPS_SUCCESS! = bps_get_event (& event, 0)) {}
    fprintf (stderr, "bps_get_event failed\n");
    break;
    }
    If {(event)
    If (bps_event_get_domain (event) is {navigator_get_domain()})
    handleNavigatorEvent (event);
    }
    } else {}
    break;
    }
    pthread_create (& t1, NULL, (void *) & rawacceleration, NULL);
    }
    }

    int main (int argc, char * argv []) {}
    screen_create_context (& screen_cxt, 0);
    bps_initialize();

    {If (EXIT_SUCCESS! = {bbutil_init_egl (screen_cxt))}
    fprintf (stderr, "bbutil_init_egl failed\n");
    bbutil_terminate();
    screen_destroy_context (screen_cxt);
    return 0;
    }

    If (BPS_SUCCESS! = screen_request_events (screen_cxt)) {}
    fprintf (stderr, "screen_request_events failed\n");
    bbutil_terminate();
    screen_destroy_context (screen_cxt);
    return 0;
    }

    If (BPS_SUCCESS! = navigator_request_events (0)) {}
    fprintf (stderr, "navigator_request_events failed\n");
    bbutil_terminate();
    screen_destroy_context (screen_cxt);
    return 0;
    }

    Rawlog = fopen (rawfilename, "w"); Save the file in a specific path.
    fprintf (rawlog, "Absorption system, Angle\n");

    navigator_request_events (0);

    While (! shutdown) {}
    handle_events();
    bbutil_swap();
    }

    closeshutdown();

    return 0;
    }

    Thank you for your attention,

    Using SENSOR_TYPE_ORIENTATION of sensor_type_t , you should be able to get > 10 Hz.  Use sensor_set_rate() to get the slower delay to call sensor_info().  Make sure not to enable sensor_set_skip_duplicates().

    However get the orientation at the 40 Hz streaming will not make your application any repsonsive more.  The only way to make your app more would be to manage the orientation change in a short period of time.  This is the time when orientation changes (at the hardware level), to receive you and to deal with it.  It is usually a constraint system and there is not that you can do about it.  What you see using the code above is the same information repeated over and over; FACE_UP, FACE_UP, FACE_UP, which is not really useful.

  • How to show the loading (wait screen) with animated image dialog between the screens

    Hello

    Can anyone show how to insert the load between two screens dialog, while the second screen is taken

    loading time?

    I tried the examples given in the forum but no luck

    There is an update about it here:

    http://supportforums.BlackBerry.com/T5/Java-development/sample-quot-Please-wait-quot-screen-part-1/t...

    Note comment added to the article as well - this is a useful Variant.

  • How to eliminate the upcoming welcome screen every time pc turned on?

    Hello once again;  It is not the screen projection I "M trying to eliminate, but logon screen it's self.   HP pavition HP - 1148p;    Windows 7 Home Edition premium you think for your time

    Hello

    Please keep your question on the same post otherwise very hard to follow. Please use the folliwng steps:

    http://pcsupport.about.com/od/Windows7/HT/auto-logon-Windows-7.htm

    Kind regards.

  • How to close the parent page popup and refreshment with click of a button.

    With Aped 4.0, I created a window close popup with this process, I am able to close the popup window after submit. But how do I update the parent page before you close the pop-up window.

    He does ' t work like this, because above JavaScript three calls does not wait for the actions to perform
    Means once the function of the saveChanges method is called, it will run funtions all three with waiting for the first action to perform. This is not the right way.

    Instead, you can use a branch of the page with the guy like branch of PL/SQL procedure with the following code.

    And Point branch: on submit: calculation of before (before the calculation, Validation and treatment)

    Begin
    htp.p('');
    end;
    
  • How to center the button on the pop-up screen

    Look at the picture, I've created a popup screen click the menu key and I have that transparent and make it mode full screen and I added four buttons vertically please, u can correct me how can I Center this button in the pop up screen.

    Here is my code

    if (Keypad.key(keycode) == Keypad.KEY_MENU)
            {
                  MysettingMenu mymenu = new MysettingMenu();
                  UiApplication.getUiApplication().pushModalScreen(mymenu);
                System.out.println("--------------Menu -key -Pressed-----------------");
    
            }
     public class MysettingMenu extends PopupScreen{
             public MysettingMenu(){
                 super(new VerticalFieldManager(), Screen.DEFAULT_CLOSE); 
    
                 this.setBackground(BackgroundFactory.createSolidTransparentBackground(Color.WHITE, 80));
    
                 setBorder(BorderFactory.createSimpleBorder(new XYEdges(),Border.STYLE_TRANSPARENT));
    
                 this.add(new ButtonField("Favourites"));
                 this.add(new ButtonField(" Settings "));
                 this.add(new ButtonField("  About    "));
                 this.add(new ButtonField("  Exit    "));
    
             }
    
            protected void sublayout(int width, int height) {
                // TODO Auto-generated method stub
                 super.sublayout(Display.getWidth(), Display.getHeight());
                  setExtent(Display.getWidth(),Display.getHeight());
                  int leftMargin = (Display.getWidth() - width)/8;
                  int topMargin = (Display.getHeight() - height)/8;
                  setPosition(leftMargin, topMargin);
            }
    
         }
    

    There are a variety of ways that this could be done, but in your case the easiest is to allow the screen to use only as much space as it needs and then place it at the Center.

    Then

    (1) change this call

    Super.sublayout (Display.GetWidth (), Display.getHeight ());

    in fact, supply the same width and height that you have been given.

    (2) remove this:

    setExtent (Display.getWidth (), Display.getHeight ());

    (3) change margin settings so that they use the actual width and height, and on this basis.  For example:

    leftMargin = int (Display.getWidth () - this.getWidth (()) / 2;

    By the way, I recommend strongly that you never call super.layout (...) ignore the size that he gave you and you deliver own setExtent.  Unless you know what you are doing, this can cause fields to display incorrectly.  If you think that you must set your own size, then I suggest you create your own Manager and do you do the layout.  More information on that here:

    http://supportforums.BlackBerry.com/T5/Java-development/how-to-extend-Manager/Ta-p/446749

  • How to close the task manager full screen?

    How to close the new task manager? There is no close button, just end task, switch or the new task. I want to talk about the program itself?

    Hello

    The Task Manager is running in tiny footprint mode - double-click on the border to return to full mode.

    Tabs in the Manager of tasks and Menu Bar missing or disappear
    http://www.mydigitallife.info/2009/01/17/Task-Manager-tabs-and-menu-bar-missing-or-disappear/

    Small footprint Mode
    http://www.howtogeek.com/wiki/Task_Manager#Tiny_Footprint_Mode

    How to switch between Normal Mode and small footprint in Vista and Windows 7 Task Manager
    http://www.Vistax64.com/tutorials/114377-Task-Manager-small-footprint-mode.html

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • How to close the popup window after executing PL/SQL?

    Hello

    To see a junior question: we use APEX 5.0.2

    On a page of the modal dialog (of an interactive report), for the button create, I created a dynamic action that runs the specific code from PL/SQL to insert a new item.  Then behind the insert clause, I have the code to close the pop-up window, so that it executes successfully the insert clause without closing the window.  Please let me know what I can do.  Thank you.

    HTP.p ("< script > '");

    HTP.p ('window.opener.Location.Reload ();) Window.Close ();') ;

    HTP.p ("< /script >" ");

    Kind regards

    Jian

    OK, thanks for all your help and ideas. Finally, I gave up running JavaScript, instead, I created another dynamic action that closes the dialog box with a later sequence (for example, it runs after the PL/SQL code).  Now, it closes the windows properly after running pl/sql clause.  Although I still wonder how to run JavaScript because it doesn't do anything, even when I create a process to run javascript directly.

  • How to close the AIR on android

    I find a problem with my application. I use navigator.pop () to switch the view.

    When the user presses back button on the view of root,

    the application closes directly. Just go to the backend ~

    How can close the application?

    You can use:

    NativeApplication.nativeApplication.exit ();

    but it will be wiser to listen to keyboard events to do.

    Check - http://blogs.adobe.com/flashplatform/2010/10/tip-close-your-android-air-app-on-back-button .html

  • How to activate the pop-up windows?

    I can't fill a demand for services with ASCAP because I've not enabled popups. So, how to activate the pop-up windows?

    You can uncheck the block pop-up windows under the Orange Firefox button > Options > Options > content tab.

    See more details here

  • How to stop the blue e screen to start the computer and also if you try to download anything

    Remember - this is a public forum so never post private information such as numbers of mail or telephone!

    How to stop the blue e screen to start the computer and also if you try to download anything:

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Hello

    We need numbers BBCode or Code to stop the bluescreens and utilities below will help you
    provide us information. Also the methods here can help you solve the bluescreens.

    Look in the Event Viewer to see if something is reported on those.
    http://www.computerperformance.co.UK/Vista/vista_event_viewer.htm

    MyEventViewer - free - a simple alternative in the standard Windows Event Viewer.
    TIP - Options - Advanced filter allows you to see a period of time instead of the entire file.

    http://www.NirSoft.NET/utils/my_event_viewer.html

    -------------------------------------------------------------------------

    Here are a few ways to possibly fix the blue screen issue. If you could give the info from the blue screen that would be
    Help. Such as ITC and 4 others entered at the bottom left. And any other information such as STOP error
    codes and info like IRQL_NOT_LESS_OR_EQUAL or PAGE_FAULT_IN_NONPAGED_AREA and similar messages.

    As examples:

    BCCode: 116
    BCP1: 87BC9510
    BCP2: 8C013D80
    BCP3: 00000000
    BCP4: 00000002

    or in this format:

    Stop: 0 x 00000000 (oxoooooooo oxoooooooo oxoooooooo oxooooooooo)
    Tcpip.sys - address blocking 0 x 0 00000000 000000000 DateStamp 0 x 000000000

    It is an excellent tool for displaying the blue screen error information

    BlueScreenView scans all your minidump files created during "blue screen of death," collisions
    Displays information on all the "crash" of a table - free
    http://www.NirSoft.NET/utils/blue_screen_view.html

    BlueScreens many are caused by old or damaged drivers, video drivers in particular, but there are other causes.

    You can follow these steps in the Safe Mode if necessary or the command prompt Vista DVD or Options of recovery if your
    system installed by the manufacturer.

    This tells you how to access the System Recovery Options and/or a Vista DVD
    http://windowshelp.Microsoft.com/Windows/en-us/help/326b756b-1601-435e-99D0-1585439470351033.mspx

    You can try a system restore to a point before the problem started when one exists.

    How to make a Vista system restore
    http://www.Vistax64.com/tutorials/76905-System-Restore-how.html

    -------------------------------------------------------------------------

    Start - type this in the search box-> find COMMAND at the top and RIGHT CLICK – RUN AS ADMIN

    Enter this at the command prompt - sfc/scannow

    How to analyze the log file entries that the Microsoft Windows Resource Checker (SFC.exe) program
    generates in Windows Vista cbs.log
    http://support.Microsoft.com/kb/928228

    The log can give you the answer if there is a corrupted driver. (Says not all possible driver problems).

    Also run CheckDisk, so we cannot exclude as much as possible of the corruption.
    How to run the check disk at startup in Vista
    http://www.Vistax64.com/tutorials/67612-check-disk-Chkdsk.html

    -------------------------------------------------------------------------

    Often drivers up-to-date will help, usually video, sound, network card (NIC), WiFi, 3rd party keyboard and
    smile, as well as of other major device drivers.

    Look at the sites of the manufacturer for drivers - and the manufacturer of the device manually.
    http://pcsupport.about.com/od/driverssupport/HT/driverdlmfgr.htm

    How to install a device driver in Vista Device Manager
    http://www.Vistax64.com/tutorials/193584-Device-Manager-install-driver.html

    How to disable automatic driver Installation in Windows Vista - drivers
    http://www.AddictiveTips.com/Windows-Tips/how-to-disable-automatic-driver-installation-in-Windows-Vista/
    http://TechNet.Microsoft.com/en-us/library/cc730606 (WS.10) .aspx

    -------------------------------------------------------------------------

    How to fix BlueScreen (STOP) errors that cause Windows Vista to shut down or restart unexpectedly
    http://support.Microsoft.com/kb/958233

    Troubleshooting, STOP error blue screen Vista
    http://www.chicagotech.NET/Vista/vistabluescreen.htm

    Understanding and decoding BSOD (blue screen of death) Messages
    http://www.Taranfx.com/blog/?p=692

    Windows - troubleshooting blue screen errors
    http://KB.wisc.edu/page.php?id=7033

    -------------------------------------------------------------------------

    In some cases, it may be necessary.

    The Options or Vista recovery disk Startup Repair

    How to do a startup repair
    http://www.Vistax64.com/tutorials/91467-startup-repair.html

    This tells you how to access the System Recovery Options and/or a Vista DVD
    http://windowshelp.Microsoft.com/Windows/en-us/help/326b756b-1601-435e-99D0-1585439470351033.mspx

    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

  • The previous user didn't verify his account. I don't know how to close the session?

    The previous user didn't verify his account. I don't know how to close the session?

    CC just asked me to check it out but it is NOT my account and I do not know whose ID is.

    And now I can not connect with my account. Help, please.

    BTW, there is NOT "Préférences."... "in the setting button.

    Windows:

    Step 1)

    Exit the desktop Adobe Creative Cloud application.

    End Adobe partner all the processes like creative cloud, CoreSync, AAMUpdater, Armsvc... etc. of the Task Manager.

    Step 2)

    Press Windows button (located between Ctrl and Alt buttons) with the key R together at once, you will get a command window.

    Type below command and press the enter"" key.

    AppData

    Then go to the Local > Adobe > OOBE. Open the OOBE folder and delete the file opm.db .

    Once you had deleted Opm.db file, run Adobe Creative Cloud application and check.

    Mac:

    Step 1)

    Exit the desktop Adobe Creative Cloud application.

    End Adobe partner all the processes like creative cloud, CoreSync, AAMUpdater, Armsvc... etc of Activity Monitor.

    Location: Applications > utilities > activity monitor.


    Step 2)

    (1) right-click on the icon in the Finder, then select 'Go - To' folder.
    (2) you will get a text box, type in the following command and then press the 'return '. (Don't miss ~ symbol)

    ~/Library

    (3) then navigate to Application Support > Adobe > OOBE. Open the OOBE folder and delete the file opm.db .

    Once you had deleted Opm.db file, run Adobe Creative Cloud application and check.

  • Close the pop-up

    I have an AM method which is exposed to the client and is used within a popup like a button 'Action '.

    How can I close the popup programmatically after the execution of the AM method when this button is clicked.

    Thank you

    1) create liaison for the popup in the myPopup say managed bean

    (2) in the command in the context menu button, have an action listener method in the managed bean that calls the method corresponding in the AM thru the operationbinding as below:

    DCBindingContainer links = (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();
    OperationBinding operationBinding = bindings.getOperationBinding("operation_name");
    operationBinding .getParamsMap () .put ("parameter_name", parameterValue);
    the operationBinding. execute();

    (3) the execution of the method, after this statement to close the pop-up window.

    this.myPopup.hide ();

    Thank you
    Nini

  • How to close the window of IE on exit_form

    Hello

    Is it possible to close the Internet Explorer window on exit_form?

    Thank you

    How do I close the browser that started a Session of forms [865745.1 ID]
    ________________________________________
    Updated August 11, 2009 Type HOWTO PUBLISHED status
    In this Document
    Goal
    Solution
    Directions for use:
    Manual steps required for FireFox:
    References
    ________________________________________
    Applies to:
    Oracle Forms - Version: 10.1.2.2.0 to 11.1
    Information in this document applies to any platform.
    Goal
    This document will describe how to close the browser window (without confirmation of the user) who was responsible for starting a session of forms.
    IMPORTANT:
    The sample program in this article is provided for educational purposes only and is NOT supported by Oracle Support Services. It has been tested internally, however and works as described. We do not guarantee it will work for you, so be sure to test it in your environment before relying on it.
    The code in this document uses Java Scripting to achieve his goal. If the client computer does not have Java script active or is blocked, this code will not work correctly. In addition, although this document was written as it applies to Oracle Forms, the functionality of the browser and how Java Script responds that it contains, is not related to the product forms. If, for some reason this code does not work for you, the problem is probably the result of changes (for example, updates) made by the supplier of the browser, or a client configuration that prevents the correct execution of the Java Script code. These problems are not related to the Oracle product and you should refer to the manuals of browser or Java script repository to debug the problem.
    This code has been successfully tested with Oracle Forms 10.1.2.3 using Internet Explorer 7 and Firefox 3.0. Be aware that FF3 is not currently certified for use with Forms 10.1.2.3 or more. Other versions may or may not work for the aforementioned reasons.
    Solution
    Directions for use:
    1. using an html editor or text, create a file html with the following code:







    Your browser or system settings prevented this window to close.


    To ensure the highest level of security,


    Please close/quit immediately this browser session.



    2. save the html with the following name: close.htm
    3 store this file on the middle tier in a directory that has an associated virtual path configured on the HTTP server. You can use an existing path or create a new. For example, in the version 10.1.2 you can copy the html file to this directory:
    ORACLE_HOME\tools\web\html
    Practically, the above corresponds to the following by default:
    genres/html /.
    For more information about creating a virtual path to the HTTP server, refer to the HTTP Server Administrator's Guide.
    4. in the Forms application, choose the desired relaxation, where you want to run the browser is closed. Don't forget that by executing this code, the application will be suddenly terminated, therefore, it is recommended that the following code only appear in the trigger of FORM post forms.
    Web.show_document ('/ forms/html/close.htm','_self');
    5. compile and run the form.
    Out of the form, the browser calls close.htm, resulting in the closing of the browser.
    This has been tested successfully using IE7 on XP - SP3. While this code works with other browsers, for example, FireFox 3, a change of configuration in FF are needed to make it work properly.
    Manual steps required for FireFox:
    1. open an instance of the FireFox browser.
    2. in the address bar, enter the following command and press enter on the keyboard:
    Subject: config
    3. in the list presented, locate the following setting:
    DOM.allow_scripts_to_close_windows
    4. double-click on this setting to set its value to TRUE
    5. exit the browser

    References
    http://msmvps.com/blogs/paulomorgado/archive/2007/11/02/how-to-close-browser-Windows-in-Windows-Internet-Explorer-7.aspx

  • How to close the invitation of calendar or calendar invitation set permissions

    How to close the invitation of calendar or calendar invitation set permissions

    Hi there Anlee9!

    It looks like invitations to other events is not something you want to receive on your iPhone on iOS 9.3.3 5s. I don't like to be interrupted myself, so I have disabled this feature and I'll be happy to show you how also.

    The area you are looking for is actually in the center of Notifications to your iPhone. Tap Settings > Notifications > calendar > Invitations that turns off.

    Have a great day and thank you for the communities of Apple Support!

Maybe you are looking for

  • connect to 9791 WSN gateway on different domain

    RE: gateway WSN-9791 I want to collect data from a WSN without going through a computer at the location of very distant field.  For 1 beat per minute, we don't need the power and the cost of a RIO, or even a laptop computer in the remote location. I

  • Macros

    I want to know how to create macros with Windows Vista Business Edition. Vista has a recorder built in and I want to also do not know if it is not in the main program is elsewhere? I have Office Professional 2007 and I am disabled, I'd like to be abl

  • Windows Explorer - my files not all be listed when I search a file or a picture while working on the web.

    I see all my files in Windows Explorer, but they disappear when I search for them so that in the websites where I want to attach a document or a picture, such as Facebook or Craigslist.  I can see 'Libraries' and 'Users', but in these cases, not all

  • How can I remove a pinkish cast to all my photos?

    I moved my computer to a new lightroom and all my photos now have a pinkish cast to them. It also seems that the grey of the histogram (highlighted) appears in pink as well. Is this a problem with the import?

  • Separate permissions for approver &amp; signer

    Today, signer and approver permissions are removed from the same checkbox in the settings of user (ability to sign documents) account. Our Organization has the need to separate these permissions, where some users can approve, but do not have the abil