Implement page Jumps

Source: Internet
Author: User

Package Com.example.ulikeguanli;
Import Java.util.Timer;
Import Java.util.TimerTask;

Import android.app.Activity;
Import android.content.Intent;
Import Android.os.Bundle;
Import Android.os.Handler;
Import Android.os.Message;
public class Welcomeguanlistart extends Activity {
Delay Jump Using Handler
@Override
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (R.layout.guanli_welcome);
/* New Handler (new Handler.callback () {
Processing the received message
@Override
public boolean handlemessage (Message msg) {
TODO auto-generated Method Stub
StartActivity (New Intent (Getapplicationcontext (), mainactivity.class));
return false;
}
}). sendemptymessagedelayed (0,3000);//delay three second send */
Timer timer=new timer ();
Timer.schedule (New Task (), 3000);
}
Class Task extends timertask{

@Override
public void Run () {
TODO auto-generated Method Stub
StartActivity (New Intent (Welcomeguanlistart.this,mainactivity.class));
}

}
}

<?xml version= "1.0" encoding= "Utf-8"?>
<manifest xmlns:android= "Http://schemas.android.com/apk/res/android"
Package= "Com.example.ulikeguanli"
Android:versioncode= "1"
Android:versionname= "1.0" >

<uses-sdk
Android:minsdkversion= "8"
Android:targetsdkversion= "/>"

<application
Android:allowbackup= "true"
android:icon= "@drawable/tubaio"
Android:label= "@string/app_name"
Android:theme= "@style/apptheme" >
<activity
Android:name= "Com.example.ulikeguanli.WelComeGuanLiStart"
Android:label= "@string/app_name" >
<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
Android:name= "Com.example.ulikeguanli.MainActivity" ></activity>
</application>

</manifest>

Implement page Jumps

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.