Listing 123 Splashjava implements splash screen functionality

package com.msi.manning.UnlockingAndroid;

/ / multiple imports omitted for brevity, see full source code public class Splash extends Activity { @Override public void onCreate(Bundle icicle) {

super.°nCreate(icicle); Q Set up main View setContentView(R.layout.splash); <-'

Handler x = new Handler () ; C Define and set x .postDelayed (new splashhandler () , 2000); y up Handler

class splashhandler implements Runnable { <1—Q Implement Handler

public void run() { startActivity(

new Intent(getApplication(),FieldService.class)); Splash. this . finish () ; <1-1

0 0

Post a comment