[html] view plain copy print?
android:layout_height="fill_parent"
android:orientation="vertical" >
android:layout_height="fill_parent"
android:scaleType="fitXY"
android:src="@drawable/splash">
</ImageView>
</LinearLayout>
2、再者,创建一个新类SplashActivity.java;
[java] view plain copy print?
public class SplashActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.splash);
Handler hd = new Handler();
hd.postDelayed(new splashhandler(), 800);
}
class splashhandler implements Runnable {
public void run() {
startActivity(new Intent(getApplication(), MainActivity.class));
SplashActivity.this.finish();
}
}
}
3、在manifest中配置我们的启动入口;
[html] view plain copy print?
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="landscape" >
</intent-filter>
</activity>
最后不要忘了要首屏的图片资源drawable/splash.png;
综上,我们APP的启动页已经做好了。雷达下载更专业。