Loading the Application and Initial Screen
There are several combinations that can be used for running an application and deciding when the initial screen should be pushed onto the display stack.
Running the application at startup
ManagedUiApplication.lifecycleStartup()
The initial screen will be pushed onto the display stack, however it will not be visible until the application is opened. This is not desirable when a splash screen is used because you will never get a chance to see the splash before it automatically continues on to the next screen. Instead, the initial screen should be pushed using ManagedUiApplication.lifecycleShow().
ManagedUiApplication.lifecycleShow()
If an initial screen is not pushed within ManagedUiApplication.lifecycleStartup(), then this function will be used for pushing the initial screen instead. ManagedUiApplication.lifecycleShow() will be delayed from getting called until the application has been opened. This works out very well for splash screens because the splash will now be visible even if the application was run at startup.
Lazy loading the application
ManagedUiApplication.lifecycleStartup()
The initial screen will become visible immediately because the application is both started and opened.
ManagedUiApplication.lifecycleShow()
This function should only be used if you intend to background the application without backgrounding on a particular screen. You will be able to move the application to the background while on one screen, and then open it and see your initial screen again. This works well for when you need to require authentication anytime the application is brought back to the foreground.
Requesting background without leaving any screens on the display stack
This is only used in pair with ManagedUiApplication.lifecycleShow()
By using ManagedUiApplication.lifecycleUnshow() you can tell the application to request the background even if there are no screens currently on the display stack. There is no longer the need to have a particular screen set to request background when you do not intend to have that screen be visible when the application comes back to the foreground. An example of this would be an application that has to display an authentication screen every time the application is brought to the foreground. If the home screen is the only screen on the display stack at the time, you would want to background the app, then you would be forced to do some magic so the home screen is not the initial screen visible when the application is brought to the foreground, but instead an authentication screen is. Instead, you can just have ManagedUiApplication.lifecycleUnshow() return false. Returning false tells the application request to background, returning true tells it to exit the application fully.
