Android Welcome screen fade-in effect

Source: Internet
Author: User

 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.