android 模擬軟件啓動界面

package org.fireking;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class WelcomePanleActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        welcome() ;
    }

    protected void welcome() {
        new Thread(){
            @Override
            public void run() {
                try {
                    Thread.sleep(2500) ;
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                Intent intent = new Intent() ;
                intent.setClass(WelcomePanleActivity.this, MainActivity.class) ;
                WelcomePanleActivity.this.startActivity(intent) ;
            }
        }.start();
    }
    
}

 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:text="歡迎界面"
        android:layout_gravity="center_horizontal"
        />

</LinearLayout>

 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章