用个线程睡眠一下就行了,下边是源码,你自己看看吧!
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE); //去掉标题栏
setContentView(R.layout.activity_the2); // 绑定布局文件
thread=new Thread(this);
thread.start();
//获取组件
}
@Override
public void run() {
try {
Thread.sleep(3000);
Intent intent = new Intent(DengluActivity.this, FirstActivity.class);
// 跳转界面
startActivity(intent);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ll = (LinearLayout)this.findViewById(R.id.loading);
Animation animation = new AlphaAnimation(0.5f, 1.0f);
animation.setDuration(1000);
animation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
Intent intent = new Intent(LoadingActivity.this,
WelcomeActivity.class);
startActivity(intent);
}
});
ll.setAnimation(animation);
利用动画实现,也可以用线程实现。sleep一下
给你个demo看看吧,你说的应该是应用启动动画。