After Android launch page jump

Source: Internet
Author: User

1.LoadingActivity

  

public class Loadingactivity extendsActivity Implementshandler.callback{PrivateHandler Mhandler; PrivateTimer Mtimer; PrivateView MView; public BooleanHandlemessage (Message parammessage) {switch(parammessage.what) {default: Return False; Case 0: StartActivity (New Intent (This, menuactivity.class)); Overridependingtransition (r.anim.left_in, r.anim.left_out); Finish (); } return False; } Note/*schedule (timertask task, long delay): Schedules the specified task for execution after the specified delay. The main idea is to execute the task after delaying delay of milliseconds. There is no mention of duplicate execution */public void onCreate (Bundle parambundle) {Super. OnCreate (Parambundle); Setcontentview ( r.layout.loading); This.mview = Findviewbyid (r.id.rl_loading); this.mhandler = new Handler (this); this.mtimer = new Timer (); thi S.mtimer.schedule (New TimerTask () {public void run () {LoadingActivity.this.mHandler.sendEmptyMessage (0) ; }}, 3000L); } public boolean onKeyDown (int paramint, keyevent paramkeyevent) {this. Mtimer.cancel (); return Super. OnKeyDown (Paramint, paramkeyevent); } protected void OnPause () {Super. OnPause ();} protected void Onresume () {Super. Onresume ();}} 

2.left_in.xml

<?xml version= "1.0" encoding= "Utf-8"?> <set xmlns:android= "Http://schemas.android.com/apk/res/android "> <translate android:duration=" android:fromxdelta= "100.0%p" android:toxdelta= "0.0"/> </set>

3.left_out.xml

<?xml version= "1.0" encoding= "Utf-8"?><set  xmlns:android= "http://schemas.android.com/apk/res/ Android ">    <translate android:duration=" android:fromxdelta= "0.0" android:toxdelta= " -100.0%p"/> </set>

After Android launch page jump

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.