最简单的安卓启动页
//上次写到一半没保存到,这次从新再来一遍
安卓
///
代码,直接复制过去就可以用了。
///
import java.util.TimerTask;
import java.util.Timer;
import android.view.Window;
import android.content.Intent;
public class Activity_First extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//去掉标题栏
requestWindowFeature(Window.FEATURE_NO_TITLE);
//从桌面进去不重新加载
if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
finish();
return;
}
//计时器,定时跳转界面
Timer timer = new Timer();
TimerTask task = new TimerTask() {
@Override
public void run() {
//注意
//把MainActivity.class改成你要跳转到类
Intent intent = new Intent(Activity_First.this,MainActivity.class);
Activity_First.this.startActivity(intent);
Activity_First.this.finish();
}
};
timer.schedule(task,2500);
}
}