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>