安卓快速启动页可加特效

来源:互联网 发布:上海交通大学学报知乎 编辑:程序博客网 时间:2024/06/05 09:28
package com.dodi.app.activity;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;


import com.example.wanmengapp.R;


public class Guide extends Activity {


private static final long SPLASH_DELAY_MILLIS = 3000;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.guide);
// 使用Handler的postDelayed方法,3秒后执行跳转到MainActivity
Handler x = new Handler();
x.postDelayed(new splashhandler(), 1200);
}


class splashhandler implements Runnable {


public void run() {
in();
}
}


@SuppressWarnings("static-access")
public void in() {
startActivity(new Intent(getApplication(),MainActivity.class));
         Guide.this.finish();
}
}
0 0
原创粉丝点击