To create a splash screen for a BlackBerry smartphone application, the MainScreen class must be extended, key and navigation events need to be consumed, and a timer can be used to dismiss the screen after a certain amount of time.
Below are two code samples showing how to implement a splash screen for BlackBerry® Device Software 4.1 and earlier, and BlackBerry Device Software 4.2 and later. Both of the samples are very similar. The SplashScreen class extends the MainScreen class. The dismiss() function is responsible for removing the splash screen and replacing it with the application's main screen. A timer is used to call the dismiss() functions after a period of 5000 milliseconds.
Where the samples differ is how navigation events are consumed. In BlackBerry Device Software 4.1 and earlier, the TrackwheelListener class is used. In BlackBerry Device Software 4.2 and later, the navigationClick(), navigationUnclick(), and navigationMovement() functions of the Screen class are used.
The following code sample shows the implementation of a splash screen.