Packagecom.example.spinnertest;Importandroid.app.Activity;Importandroid.content.Intent;ImportAndroid.os.Bundle;ImportAndroid.view.View;ImportAndroid.view.Window;ImportAndroid.view.WindowManager;Importandroid.view.animation.AlphaAnimation;Importandroid.view.animation.Animation;ImportAndroid.view.animation.Animation.AnimationListener; Public classWelcomeactivityextendsactivity{@Overrideprotected voidonCreate (Bundle savedinstancestate) {//TODO auto-generated Method StubSuper. OnCreate (savedinstancestate); Requestwindowfeature (Window.feature_no_title); GetWindow (). SetFlags ( Windowmanager.layoutparams. Flag_fullscreen, Windowmanager.layoutparams. Flag_fullscreen); Setcontentview (r.layout.welcome_activity);FinalView view =Findviewbyid (r.id.welcome_layout_id); Alphaanimation AA=NewAlphaanimation (0.3f,1.0f); Aa.setduration (2000); view.startanimation (AA); Aa.setanimationlistener (NewAnimationlistener () {@Override Public voidonanimationend (Animation arg0) {Intent Intent=NewIntent (welcomeactivity. This, Mainactivity.class); startactivity (intent); Finish ();} @Override Public voidonanimationrepeat (Animation Animation) {} @Override Public voidOnanimationstart (Animation Animation) {}});}}
<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:id= "@+id/welcome_layout_id"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical" > <TextViewAndroid:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:gravity= "Center"Android:text= "Hello World"android:textappearance= "@android: Style/textappearance.large"/> </LinearLayout>
Using the theme Android:theme= "@android: Style/theme.devicedefault"
Android Welcome screen fade-in effect