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 {
//延时跳转使用handler
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.guanli_welcome);
/* new Handler(new Handler.Callback() {
//处理接受到的消息
@Override
public boolean handleMessage(Message msg) {
// TODO Auto-generated method stub
startActivity(new Intent(getApplicationContext(),MainActivity.class));
return false;
}
}).sendEmptyMessageDelayed(0,3000);//延时三秒发送*/
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="18" />
<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>