I have multiple different Activity in my app and I don't want any transition animation when changing between Activities. Below is the how I'm changing between Activities:
Intent i = new Intent(FirstActivity.this, SecondActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(i);
This works great the first time I start a new Activity. There is no animation, but when I go back to an Activity that is already started it seems like the "Intent.FLAG_ACTIVITY_NO_ANIMATION" is ignored and the default animation happens.
I can't seem to figure out why this is happening.
Open Settings . Scroll down and select Accessibility. Scroll down to Display and tap Text and display. Tap the toggle switch for Remove animations to turn it on.
Have you tried overridePendingTransition()
?
You can set FLAG_ACTIVITY_REORDER_TO_FRONT by code and FLAG_ACTIVITY_NO_ANIMATION in manifest as below:
Create noAnimTheme in res/values/styles.xml
<style name="noAnimTheme" parent="android:Theme"> <item name="android:windowAnimationStyle">@null</item> </style>
or
<style name="noAnimTheme" parent="android:Theme.NoTitleBar"> <item name="android:windowAnimationStyle">@null</item> </style>
and use it in manifest:
<activity android:name="SecondActivity" android:theme="@style/noAnimTheme"/>
I hope it helps
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