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>
本文详细解析了Android应用中启动Activity的过程及如何实现界面跳转,包括使用Intent进行页面切换,并通过线程控制延迟加载界面,提高用户体验。
2550

被折叠的 条评论
为什么被折叠?



