android 模拟软件启动界面

来源:互联网 发布:网络通俗歌手大赛孟丹 编辑:程序博客网 时间:2024/05/16 15:42

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>

 


原创粉丝点击