Android APP startup Interface

Source: Internet
Author: User

Android APP startup Interface
If you are new to Android App development, you may encounter a problem, that is, when someone else's App first enters a page that disappears after a while, this page can be used for advertising, you can also declare the topic of the App, so this launch page is crucial. Next, I will share my code with you to remember that this activity should be stored in Androidmanifest. the declaration in xml is the main page, that is, the <activity
Android: name = "com. gp. acitivity. AppStart">
<! -- Set the program to be started first. Copy the following code to the specified position for the Activity to be started -->
<Intent-filter>
<Action android: name = "android. intent. action. MAIN"/>
<Category android: name = "android. intent. category. LAUNCHER"/>
</Intent-filter>
</Activity> Inflate () can be understood as "implicit expansion", which is placed in the view implicitly. Before inflate (), only the control is obtained, but no size is occupied by the View space, inflate () has a certain size, just out of the hidden state. as for this AlphaAnimation is a transparent animation, 0.3f to 1.0f is transparent, and the effect is certainly better than 0.5f to 1.0f.
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); That is, set the duration.How long does the page disappear after it appears? The onAnimationEnd method of the rewrite below is what it will do after the animation page ends. We will add a redirectTo method here to jump to another page after the animation ends. My blog will be updated occasionally. If you like it, follow me. I am a great android player, we will see you later.

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.