About the Android App launcher interface

Source: Internet
Author: User

Just learn Android app development friends, may encounter a problem, is someone else's app just enter will have a page appear a moment after disappear, this page can be used to advertise, can also declare the theme of the app, so say this launch page is very important, next, I'm sharing my code with you. Remember that this activity is to be declared as the main page in Androidmanifest.xml, which is <activity
Android:name= "Com.gp.acitivity.AppStart" >
<!--set the program that starts first, and to start which activity, copy the following code to the specified location--
<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>
</activity> inflate () or can be understood as "hidden expansion", hidden in view, inflate () just get control, but no size does not occupy space in the view, inflate () after a certain size, Just out of the hidden state. As for this alphaanimation is a transparent animation effect, 0.3f to 1.0f is transparent degree, the effect is certainly better than 0.5f to 1.0f effect
public class AppStart extends Activity {        @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        final View view = View.inflate(this, R.layout.start, null);        setContentView(view);               
        AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);        aa.setDuration(2000);        view.startAnimation(aa);        aa.setAnimationListener(new AnimationListener()        {            @Override            public void onAnimationEnd(Animation arg0) {                redirectTo();            }            @Override            public void onAnimationRepeat(Animation animation) {}            @Override            public void onAnimationStart(Animation animation) {}                    });    private void redirectTo(){                Intent intent = new Intent(this, Main.class);        startActivity(intent);        finish();    }} aa.setDuration(2000);就是设置持续时间,就是这个Page How long do you want to make it disappear? The following Onanimationend method is what to do after the animation page ends. We're just going to add a Redirectto method to make the animation jump to another page. My blog will be updated occasionally oh, like I pay attention to me, I am the great god of Android, we will see you next time.

About the Android App launcher interface

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.