Create a full-screen picture via ImageView:
<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical" > <ImageViewAndroid:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:src= "@drawable/splash"Android:scaletype= "Center" /></LinearLayout>
New activity:
PackageCom.example.testwelcome;Importandroid.app.Activity;Importandroid.content.Intent;ImportAndroid.os.Bundle;ImportAndroid.os.Handler;ImportAndroid.widget.Toast; Public classWelcomeactivityextendsactivity{protected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (R.layout.welcome); NewHandler (). postdelayed (NewRunnable () {@Override Public voidrun () {//TODO auto-generated Method StubIntent Intent =NewIntent (welcomeactivity. This, Mainactivity.class); StartActivity (Intent); Welcomeactivity. This. Finish (); } }, 2000);//jump to another page after two seconds }}
Androidmanifest.xml
Set the default startup Welcomeactivity and set the theme to full-screen untitled style
<ApplicationAndroid:allowbackup= "true"Android:icon= "@drawable/ic_launcher"Android:label= "@string/app_name"Android:theme= "@android: Style/theme.black.notitlebar.fullscreen" > <ActivityAndroid:name= "Com.example.testwelcome.WelcomeActivity"Android:label= "@string/app_name" > <Intent-filter> <ActionAndroid:name= "Android.intent.action.MAIN" /> <categoryAndroid:name= "Android.intent.category.LAUNCHER" /> </Intent-filter> </Activity> <ActivityAndroid:name= "Com.example.testwelcome.MainActivity"></Activity> </Application>
>> Example Download