ImageView tu1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.welcomeactivity); tu1= (ImageView) findViewById(R.id.tu1); setAnimation(); } private void setAnimation() { AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1); alphaAnimation.setDuration(3000); alphaAnimation.setInterpolator(new AccelerateInterpolator()); alphaAnimation.setAnimationListener(new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { Intent intent=new Intent(WelcomeActivity.this,MainActivity.class); startActivity(intent); finish(); } @Override public void onAnimationRepeat(Animation animation) { } }); tu1.startAnimation(alphaAnimation); }
转载于:https://my.oschina.net/u/3581694/blog/1153844