OverridePendingTransition in Android SDK not working

I am trying to change the transition between two actions in an android app. I found that overridePendingTransition will do the job, but it doesn't seem to work for me. This is the code I'm working with:

@Override
 public void onCreate(Bundle savedInstanceState)
 {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.splash);

  ImageView logo = (ImageView) findViewById(R.id.ImageView01);
  Animation fade = AnimationUtils.loadAnimation(this, R.anim.fade_in);

  fade.setAnimationListener(new AnimationListener() {

   @Override
   public void onAnimationRepeat(Animation animation) {
    // TODO Auto-generated method stub

   }

   @Override
   public void onAnimationStart(Animation animation) {
    // TODO Auto-generated method stub

   }

   @Override
   public void onAnimationEnd(Animation animation) {
    startActivity(new Intent(FDSplashActivity.this,
      FDGameActivity.class));
    FDSplashActivity.this.finish();
          overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
   }

  });
  logo.startAnimation(fade);
}

It is assumed that it displays a splash screen, disappears in the logo, and then switches to another action. This works, but not the string overridePendingTransition (R.anim.fade_in, R.anim.fade_out) ;. When I find it in Eclipse, it simply says: "The overridePendingTransition (int, int) method is undefined for the type new Animation.AnimationListener () {}"

Please help me.

+5
source share
1

overridePendingTransition - Activity. , (),

FDSplashActivity.this.overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
+13

All Articles