I use overridePendingTransition for when my activity is created, and it works great. I can see that attenuation works fine, but when I try to animate the finish in my activity, it still defaults to right to left.
At first I tried to define the animation out when I start the action 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 to do this when I finish the work 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 none of these approaches will prevent a right-to-left slide to animate the output. Any ideas on what I'm doing wrong?
android android-activity animation
b-ryce Dec 02 2018-10-12T00: 00Z
source share