直接看实例吧
package com.example.textview; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; public class SplashActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState ){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); new Handler().postDelayed(new Runnable() { public void run() { /* Create an Intent that will start the Main WordPress Activity. */ Intent mainIntent = new Intent(SplashActivity.this, MainActivity.class); SplashActivity.this.startActivity(mainIntent); SplashActivity.this.finish(); } }, 2900); //2900 for release } }在实例操作前,须要自己建立好至少两个Activity ,假设不会新添加Activity。能够查看前面的一篇文章 Android新增Activity,并实现多Activity之间的切换