Not everything that needs to be done can be done on a single screen. The samples that we've made so far have used only one screen in order to keep things simple, but most applications will need many more. Switching between screens is a very common task and one that the SDK supports using the UI Stack. Each UiApplication
has a stack of screens that you can use to manage the transition from one screen to the next. This stack actually places the entire Screen
object onto the stack, so when you return from one screen to the previous one, the state of the previous screen
has been preserved.
We first encountered the UI Stack in Chapter 4, Creating your First BlackBerry Project while setting up the TipCalcApplication
constructor. This constructor does only one thing: makes a call to the pushScreen
method that places the first (and only) screen onto the UI Stack. In order to display another screen to the user, all you need to do is to place another Screen
object onto the...