I'd like to know the proper place to put GUI based sequential start-up code in my Blackberry app.
In main(), I create MyApp and enterEventDispatcher()
I have UiApplication (MyApp)
In the MyApp CTOR:
- I create a MainScreen (MyMain)
- I call pushScreen() on MyMain
When the event dispatcher starts, is there an event I can listen for in my MainScreen that will give me the event thread where I can happily do synchronous start-up tasks?
I can use invokeLater() but I want each call to block because their order is important in this phase. invokeAndWait() throws an exception in most cases where I've attempted to use it.
I've attempted the code below but I get an exception when trying to run on the "Testing 1 2 3" line.
public class MyApp extends UiApplication { static public void main(String[] args) { new MyApp().enterEventDispatcher(); } public MyApp() { MyView theView = new MyView(); theView.startUpdateTimer(); pushScreen(theView); Dialog.alert("Testing 1 2 3"); } }