一、添加简单的欢迎界面
1、欢迎界面的布局文件,welcomebg为图片文件
<?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" android:background="@drawable/welcomebg" > </LinearLayout>
2、AndroidManifest.xml添加属性(无标题,无状态栏,竖屏)
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:screenOrientation="portrait
3、重要代码:
(1)在onCreate方法中创建新线程,时间2s,并从Activity1跳转到Activity2
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
// TODO Auto-generated method stub
startActivity(new Intent(getApplication(),NextActivity.class));
MainActivity.this.finish();
}
}, 2000);
二、动画欢迎界面实现