Events that fire after screen infrastructure?

Hello

I am writing a little game.  I use the same top-level class that we've all seen in the tutorials.  He did push a TitleScreen object, which extends the fullscreen RIM class, in the stack to display and then delve into the event dispatcher.  Initially, the TitleScreen contains only a background graphic and a LabelField that says "Loading"... ».

Then, the GameScreen object is very large and its constructor instantiates a large number of other objects.  Instantiating this object takes between five and ten seconds to arrive, according to the model of Blackberry.

Once the GameScreen object is loaded into memory, I change the TitleScreen, add() and delete() methods in the class of the screen to remove the "Loading...". ' LabelField and replace it with a ButtonField labeled 'Start '.

I used to have the code for these three steps in the main() method.  Everything works well except that the 'Loading... '. "TitleScreen is never drawn on the screen until the program begins the GameScreen object is instantiated and all his baggage.  Point of view of the user, when my program starts the phone just hangs for five to ten seconds, and then the TitleScreen with the 'Start' button appears. It's the wrong shape and that's the problem I'm trying to fix.

The idea is to paint the TitleScreen with the 'Loading... '. ' LabelField on the screen, THEN instantiate the object GameScreen big, fat, sloppy.  Looks like a good theory, but it depends on the frame RIM let me know when the initial TitleScreen is painted and displayed on the top of the display.

In reality, the RIM framework provides appropriate notification that the TitleScreen is displayed.  In the TitleScreen, I replaced the onExposed() method.  However, when the screen first, onExposed() is not called.  My program crashes with the 'Loading... '. "TitleScreen displayed.  Apparently, the framework calls onExposed() only after that the screen is hidden, and onObscured() is called.

I tried to rename the method so it replace onDisplay(), but this method is called before the TitleScreen is painted on the screen, so this does not solve my problem.

I tried to rename the method so it replace onFocus (int), but never, the framework calls this method when the form is first displayed.  Still, my program hangs with the "Loading...". "TitleScreen displayed.  I think it's because the TitleScreen contains no fields that can receive the focus.

I tried to rename the method so it replaces onFocusNotify (boolean), but again, this method is called before my TitleScreen is painted on the screen.

This seems to cover all the methods that I could replace in the Screen class that could solve this problem.  I can't think of anything that could help me.

How can I get the frame RIM to wake up my event feed and let me know that my screen was pushed, painted and displayed?

I suspect that what is happening is maybe because you do not use the framework correctly.

User intervention, including painting the screen and user input processing, occurs on the event Thread.  It is a special thread that is, if I understand correctly, the same Thread that is used to treat the main().  In any case, at the start, when you issue the thrust at bottom, it is not actually processed immediately, it is planned for the thread of events.  This push for complete, you enterTheDisplatcher.  Given the way you treat your startup, this does not happen until you actually complete your initialization which includes the construction of your intended to GameScreen.

In reality, all you have to do is to display the loading screen, then start a Thread that creates the object background GameScreen.  Once created, it can update the screen way * ensuring that he returned to the event Thread to do this processing.

There are examples of splash screens in the KB and forum (search for splash screens).  They are similar to your loading screen work, however, memory, they all assume that the second screen is available - so spend you the start of the second screen to display screen and how long to stall and it does that a stall, a pop (of himself) and a boost (from the replacement of the screen) I don't think that this process will work for you , because of the delay in the creation of the replacement screen.  But you might find something of value in the KB so please take a look.

Tags: BlackBerry Developers

Similar Questions

  • The event that fires when a planned widget receives focus?

    I looked for days but can't find any event that fires when a substantive widget Gets the focus again.  Is this possible?  If all goes well, just something miss me obivous here...

    onForeground found here:

    http://www.BlackBerry.com/developers/docs/widgetapi/BlackBerry.app.event.html

  • What is the custom event that fires?

    Hello

    What is customized event triggered in the OPA.

    I heard that, at the time of the training online OPA in last week.

    A custom event is a way to write a rule that will send a signal. When executing time event listeners can be attached to the motor of the OPA, and a custom event can be used as a way to signal that something should happen.

    For Documentation on writing a raiseevent rule see rules of use to trigger external software applications in modeling of political Oracle Help.

    For Documentation on the event listeners, see events and event handlers and example: handle the events of modules with an inference event listener in Oracle policy Automation Developer Help.

  • Is there an event that fires when the add attachments

    Is it possible to add JavaScript to run when a user is joined to a file?

    Hello

    There is no event triggering, but you can control JavaScript code to add the attachment using the importDataObject (see the Acrobat JS QAnywhere document for more details), if you do not specify the cDIPath parameter, it will display a dialog box.

    Then you can run JavaScript extra after completing the call above, the function returns true if it was able to import the file and this is why you can use this to control if you run code or not.

    The JS Acrobat API reference document can be downloaded as part of the SDK from here - http://www.adobe.com/devnet/acrobat/sdk/eula.html

    or the online version is here - http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/JS_API_AcroJSPreface.87.1.html

    To use the 'doc' of acrobat object in LiveCycle Designer replace the part 'doc' "event.target."

    Hope this helps

    Malcolm

  • How can I fix the blue screen that appears after the Welcome screen and also the compaq screen changed after windows update the or to the 03/23/11

    March 23 windows set to date. a failure and then managed. After that, the compaq screen has changed and the blue display lights for a little after the Welcome screen.

    Hello

    If you think the update caused the blue screen then uninstall it to check.

    Control Panel - Windows Updates - lower left Installed Updates - uninstall or change

    Or

    Remove an update
    http://windowshelp.Microsoft.com/Windows/en-us/help/182043da-fc3e-4220-AFBC-d9b09f2b2a1a1033.mspx

    Or

    The problems with the removal of updates
    http://windowshelp.Microsoft.com/Windows/en-us/help/5a319824-5cb5-493d-9151-9a97d0f565b61033.mspx
    Or

    How to uninstall updates in Windows Vista
    http://www.vista4beginners.com/how-to-uninstall-Windows-Vista-updates

    Disable or hide optional updates on Windows Vista
    http://www.howtogeek.com/HOWTO/Windows-Vista/disable-or-hide-optional-updates-on-Windows-Vista/

    ==============================================================

    If not, remove the updates help then we can troubleshoot the BlueScreens.

    Check this thread for more information using BlueScreenView, MyEventViewer and other methods
    to troubleshoot the BlueScreens - top 3 responses (+ 1 other).

    http://social.answers.Microsoft.com/forums/en-us/vistarepair/thread/3deab2fa-4000-4136-8c78-a3d22b1db009

    We can analyze the minidumps if make you it available to the SkyDrive or another file
    sharing sites.

    ZIP or download the content of the C:\Windows\minidump

    Use SkyDrive to upload collected files
    http://social.technet.Microsoft.com/forums/en-us/w7itproui/thread/4fc10639-02dB-4665-993a-08d865088d65

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

    Also this, so you can see the probable bluescreens.

    Windows Vista restarts automatically if your computer encounters an error that requires him to plant.
    (also Windows 7)
    http://www.winvistatips.com/disable-automatic-restart-T84.html

    ===========================================================

    Check out these utilities to see if information may be collected:

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

    -Free - BlueScreenView scans all your minidump files created during "blue screen of death," collisions
    and displays information about all accidents of a table.
    http://www.NirSoft.NET/utils/blue_screen_view.html

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

    MyEventViewer can be verified at the time of the blue screen (BSOD) within a second or so of the
    time of the BSOD to provide more information about the possible cause - see TIP.

    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 whole of the record-
    Set it for a bit before and after the time of the BSOD.
    http://www.NirSoft.NET/utils/my_event_viewer.html

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

    AppCrashView - free - a small utility for Windows Vista and Windows 7 that displays the details of all the
    application goes down has occurred in your system. The information breaks down is extracted from the .wer
    the files created by the Windows Error Reporting (WER) of the operating system component of each
    time that an accident has occurred. AppCrashView also allows you to easily record the list of accidents to
    text/html/csv/xml file.
    http://www.NirSoft.NET/utils/app_crash_view.html

    I hope this helps.

  • After that start monitor/screen becomes black with visible vertical lines

    After that start monitor/screen becomes black with visible vertical lines. Move the mouse shows an activity going on behind the disorder. My son says video card?

    Hi Melissa,

    ·         Since when are you facing this problem?

    ·         Have you checked the issue by connecting a different monitor?

    Step 1: It seems to be a hardware issue to me. Check if the cables are well connected.

    Step 2: Connect another monitor to the computer and see if the problem persists.

  • Blue screen event (without real blue screen) and 3 simultaneous Live kernel event

    I am running Windows 7 Professional Service Pack 1 with Internet Explorer 10, with all current updates.

    Today, I searched through the observer of events under Windows Logs/Applications and has seen several entries to Windows Error Reporting. I noticed that a blue screen event was registered today, although I had not seen any real screen blue, or had no gel or any difficulty whatsoever. A minidump was created. At the exact time that the blue screen was recorded, three core events Live were also recorded and creates three .dmp files.

    I thought it was unusual because it is not the first time that this has happened. I had six blue screens in six months, without actually seeing a blue screen or the system freeze or lock up on me.

    Is it Blue Screen/Live kernel events indicative of an imminent failure? It is a desktop Dell OptiPlex 390 computer, purchased in January of 2012.

    Thanks for any idea, you may be able to provide.

    DK

    Thanks this works.  There are two problems that both resolved easily.  Kaspersky first and second CHDRT32.sys High Definition Audio Driver Conexant Systems function related

    I remove Kaspersky and using MSE instead and update the driver Conexant for the most recent driver available, even if it is the same date that drivers become corrupt

    Kaspersky is a common cause of BSOD.


    I remove and replace it with Microsoft Security Essentials at LEAST FOR TESTER.

    http://support.Kaspersky.com/downloads/utils/kavremover10.zip
    http://www.Microsoft.com/security_essentials/

  • I was running Mozilla firefox on my computer until two weeks ago. At that time, the screen went black and now I am not able to use it.

    I was running Mozilla firefox on my computer until two weeks ago. At that time, the screen went black and now I am not able to use it.  When I click on the icon and open to the top it says cannot load xp.com and a flag of resolution comes up saying it can't run a resolution less than 1930 x 2300. I have no idea what this means and how I can solve this problem.  I thought that maybe the application was bad, so I deleted and then added it back on and it does the same thing.  I even did a restore of the system to try hard but nothing I did the work.  So, how can I solve this problem.  I'm not a computer genius, so he must be explained in simple easy to understand instructions.

    Hello

    I suggest that you view in Mozilla Firefox community because there seems to be a Firefox problem.

    https://support.Mozilla.org/en-us/

    Some examples of the problem:

    «I can't open Firefox, it says could not load xpcom.» Who is wrong? »

    https://support.Mozilla.org/en-us/questions/965228

    "I get an error"Unable to load XPCOM". I know that I can reinstall Firefox, but how do I save my favorites?

    https://support.Mozilla.org/en-us/questions/1029239

    'Error message cannot open the XPCOM and impossible to open ALL pages '.

    https://support.Mozilla.org/en-us/questions/1006494

    Here is a YouTube video on fixing this error:

    https://www.YouTube.com/watch?v=x_C2eaNj234

    See you soon.

  • Where to find images that freezes my screen saver

    My screensaver is family pictures, I have two photos that freezes my screen saver when they appear. But I went through all the photos in my pictures and I can't find these two photos! So where should I look for to delete?

    Hello

    1. which version of the operating system you are using on the computer?
    2. don't you make changes on the computer before the show?
    3. What is the file format?

    Method 1:
    You can view hidden files and check:
    Check out the link and uncheck the hidden files, folders and drivers
    http://Windows.Microsoft.com/en-us/Windows7/show-hidden-files

    Method 2:
    You can scan System File Checker to fix corrupted files.
    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7
    http://support.Microsoft.com/kb/929833
    Method 3:
    See the steps from the link to recover deleted files.
    http://Windows.Microsoft.com/en-us/Windows7/recover-lost-or-deleted-files

    Method 4:
    Run a Microsoft security scanner to make sure that the computer is free from virus infection:
    http://www.Microsoft.com/security/scanner/en-us/default.aspx
    WARNING:
    If you run the antivirus program that is infected by the virus scan will get deleted. Therefore, reinstall the program. Also if the files and folders are affected by the virus, while they might even get deleted

    Reference link:
    Photo management
    http://Windows.Microsoft.com/en-us/Windows7/managing-your-pictures

  • Is there a button to push that initiates the screen saver without delay to launch?

    Is there a button to push that initiates the screen saver without delay to launch? I want to apply the screasaver with out having to wait the time it takes so that it starts on its own. Looking to see if there is a way to do this?

    Is there a button to push that initiates the screen saver without delay to launch? I want to apply the screasaver with out having to wait the time it takes so that it starts on its own. Looking to see if there is a way to do this?

    see if you can use this tutorial...
    To create an icon to launch the screensaver.

    http://www.howtogeek.com/HOWTO/Windows-Vista/create-icons-to-start-the-screensaver-on-Windows-Vista/

    PS adding...

    An easy way, scroll down for:

    Download of shortcut icons (Vista only). The author has created a "ready-made shortcuts.

    I have not tried. I can't guarantee it.* *.

  • is it possible that a single screen will work with the slider and second focus mode

    Hello

    can you please tell me is it possible that a single screen will work with cursor mode and second focus mode.

    Thank you

    Hello

    I don't think that it is possible to change the mode of the development of your application outside of in the config.xml file.

    A custom extension may be able to do this, but I have not seen anyone this yet.

  • can I clean my administrative events I 25 500 events that I need help

    I couldn't believe the number of events that I have accumulated in a period of two to three years. Talk to the technicians that they want a lot of money to clean up events. I wonder if I can do it myself with the help on how to do

    Hello

    You are the very welcome.

    Try posting your question in the Windows 7 forum. There may be a way to modify the batch file to achieve this.

    Jaco

  • How to set or keep a background image in my application at the beginning of the application that is, after clicking on the application icon.

    How to set or keep a background image in my application at the beginning of the application that is, after clicking on the application icon.

    I have developed a BB 7.0 BONE HTML5 / web app in which I want to include background image.

    Please guide me.

    Take a loot of rim: loadingScreen on config.xml http://developer.blackberry.com/html5/documentation/rim_loadingscreen_element_834680_11.html

  • How to listen for events that hit the application?

    How to register an event listener in a subcomponent to listen to events that spread at the Application level?

    For example: Comp1 raises an event that is spreading to the hand. How to register Comp2 listening to this event?
    Main.MXML (Application)
    -Mgr1
    -Ordi1
    -Mgr2
    -Comp2

    The code that would be placed in the component and the hand would be greatly appreciated.
    Thank you.

    Try this:

    . AddEventListener (Application.application as Application)...

    from the inside of any component.

    Tim

  • event/application of display screen shows 'Warning' to an entry (after "check disk"), how do I do now?

    Hello-

    After the race "check disk", I went to the visualization/event application screen.  I had a 'warning' / / source, windows search service / / category, Gatherer / / event, 3086. "When I clicked on it, I arrived at the EVENTS AND ERRORS MESSAGE CENTER.  I did a search for 3086, refined by XP pro.  She did an article; When I clicked the link to this article, I came to http://support.microsoft.com/kb/931760 (I show the title only because the article is very long) - you can not install Windows XP successfully after you use Windows Vista or Windows PE 2.0 to create partitions on a hard drive on the article has something to do with the creation of partitions , which i know I never did.  more I never had vista installed, and I did not know "windows preinstallation environment 2.0" is.
     
    My Qs-

    (1) this article is applicable to me?  There a fix which are related, but he also says not to apply the fix, I'm not exactly the article describes the problem.  I don't think that I do, but I'm not positive that I even understand what the problem right is described in article.

    (2) am, supposed to do something as a result of the original 'WARNING' from the screen of application of visualization/event and if so, what?

    (3) am I supposed to bring some type of change some setting somewhere, and if so, what change, how and where?

    (4) am I hopelessly paralyzed my computer, and if so, how can I solve this?

    (5) I even asked the Qs right?

    Thank you very much to all those who can help you!

    -susie margaret

    Hello susie margaret

    No, I wouldn't use this hotfix.

    1. Why did you decide to run the check disk in the first place?

    2. is your partitioned hard drive?  You have more than one listed partiton for example in workstation?

    3. the machine works well?

    .

Maybe you are looking for