码迷,mamicode.com
首页 > 其他好文 > 详细

实现页面跳转

时间:2016-05-02 13:06:48      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

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>

实现页面跳转

标签:

原文地址:http://www.cnblogs.com/llforeverlove/p/5452129.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!