I'm using overridePendingTransition for when my activity is created and that works fine I can see the fade in works great, but when I try and animate the finish on the activity it is still doing the default right to left slide.
I first tried defining the out animation when I start the activity as follows:
Intent myIntent = new Intent(a, SkdyAlert.class); myIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); a.startActivity(myIntent); if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.DONUT) { AnimationHelper.overridePendingTransition(a, R.anim.fadein, R.anim.fadeout); }
Then I tried doing it when I finish the activity as well
okBtn.setOnClickListener(new OnClickListener() { public void onClick(View v) { finish(); if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.DONUT) { AnimationHelper.overridePendingTransition(activity, 0, R.anim.fadeout); } } });
But neither of these approaches will prevent the "right to left" slide for the exit animation. Any ideas on what I'm doing wrong?
Android's transition framework allows you to animate all kinds of motion in your UI by simply providing the starting layout and the ending layout.
I override pending transition just after calling finish();
In my case, I have done it to avoid transitions.
finish(); Details.this.overridePendingTransition(R.anim.nothing,R.anim.nothing);
Order is important :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With