12-27-2011 10:45 AM
Solved! Go to Solution.
12-27-2011 11:01 AM
Attach RadioStatusListener or CoverageStatusListener (or both) depending on what you are trying to accomplish. Enter the event loop in the app code so that the application does not exit. Prepare the state of your application based on the callbacks you receive on the listeners. Push your screen on to the display stack when the app is ready (make sure to use invokeLater() to push the screen if you are doing that from a non-event thread). That should do it.
12-27-2011 11:09 AM
12-27-2011 11:40 PM - last edited on 12-27-2011 11:43 PM
Pseudocode:
MyApp -> UiApplication, Runnable
{
main()
{
MyApp app = new MyApp() ;
new Thread(app).start() ;
app.enterEventDispatcher() ;
}
run()
{
prepareAppWithYourLogic() ;
invokeLater(new Screen()) ;
}
}
Screen -> MainScreen, Runnable
{
run()
{
UiApplication.getApplication().pushScreen(this) ;
}
}
I am not sure whether the event loop will block or exit - we have not pushed a screen on the display stack at that point in time. If it exits, make the thread wait() instead and notify() from the spawned thread when initialization is done. The main thread can then push the screen on the stack and enter the event loop.
12-29-2011 07:31 PM