Android启动页

在清单文件中配置

     //启动页
        
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoTitle.Fullscreen">
            
                
                
            
        

LaunchActivity.java

public class LunachActivity extends AppCompatActivity {

    private static final long SPLASH_DELAY_MILLIS = 3000;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_lunach);

        // 使用Handler的postDelayed方法,3秒后执行跳转到MainActivity
        new Handler().postDelayed(new Runnable() {
            public void run() {
                goHome();
            }
        }, SPLASH_DELAY_MILLIS);
    }
    private void goHome() {
        Intent intent = new Intent(LunachActivity.this, MainActivity.class);
        LunachActivity.this.startActivity(intent);
        LunachActivity.this.finish();
    }

}

你可能感兴趣的:(Android启动页)