There will be a welcome page for a few seconds before you enter the software, such as:
This requires two activity mates:
Welcomeactivity and mainactity;
Also need to pay attention to the more software entry interface, that is, change the value in the Androidmainmanifest.
Here is the code in Androidmainmanifest:
<activity android:name= "com.jerehedu.headline.WelcomeActivity" android:label= "@ String/title_activity_welcome "> <intent-filter> <action android:name=" Android.intent.action.MAIN "/> <category android:name=" Android.intent.category.LAUNCHER "/> < /intent-filter> </activity> <activity android:name= " Com.jerehedu.headline.MainActivity " android:label=" @string/app_name "> </activity >
Then there is the OnCreate method in Welcomeactivity:
protected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Requestwindowfeature (window.feature_no_title);//This sentence means to delete the default titlebar Setcontentview (R.layout.activity_welcome); NewHandler (). postdelayed (NewRunnable () {//here is equivalent to the first parameter of handler @Override Public voidrun () {Intent mainintent=NewIntent (welcomeactivity. This, Mainactivity.class); Welcomeactivity. This. StartActivity (mainintent); Welcomeactivity. This. Finish (); } }, 1000); Here, 1000 means 1000 milliseconds, or 1 seconds.
Welcomeactivity XML is the imageview you need to make a welcome page;
Then the mainactivity is your own code.
Add a welcome page to Android