Kill the splash screen

Like most Activity classes in Android, we want to associate the splash layout with this Activity's View O. A Handler is set up ©, which is used to close down the splash screen after an elapsed period of time. Note that the arguments to the postDelayed method are an instance of a class that implements the Runnable interface and the desired elapsed time in milliseconds. In this snippet of code, the screen will be shown for 2000 milliseconds, or 2 seconds. After the indicated amount of time has elapsed, the class splashhandler © is invoked. The FieldService Activity is instantiated with a call to startActivity Q. Note that an Intent is not used here—we explicitly specify which class is going to satisfy our request. Once we have started the next Activity, it is time to get rid of our splash screen Activity, Q.

The splash screen is happily entertaining our mobile worker each time he starts the application. Let's move on to the main screen of the application.

0 0

Post a comment