Another easy way using Timer class to use splash screen

public class SplashActivity extends Activity{
    Context context;
    Timer splashTimer;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);
        context= this;
        splashTimer =  new Timer();
        splashTimer.schedule(new TimerTask() {
 
            @Override
            public void run() {
                updateValue();
            }
        }, 1000, 15000);// 1 second for initial start value and 15 seconds to display splash screen
         
    }
    public void updateValue()
    {
         
        Intent intent =  new Intent(context, .class);
        startActivity(intent);
        splashTimer.cancel();
        finish();
    }
 
}

 

from http://www.itcuties.com/android/how-to-create-android-splash-screen/

你可能感兴趣的:(screen)