I need to disable Activity transition animation for all the screens in my application. Previous solution worked fine for all Android version:
<style name="base_theme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowAnimationStyle">@null</item>
</style>
... but for Android 8 "Oreo" it cause black screen blinking for every transition (forward or back move). I.e. there is still no any animation, but very annoying blinking take place (90% chance, ~20-30 milliseconds, the whole screen).
According to my "research":
- it does not depends on activity content and reproduced with empty activities
- there is no any background work which could slow down the transition process
- Intent.FLAG_ACTIVITY_NO_ANIMATION blinks as well
- overridePendingTransition(0,0) doesn't work too
The only solution I could find:
Define an empty transition animation
<?xml version="1.0" encoding="utf-8"?>
<set />
and apply it to every activity in the application (onCreate & finish)
overridePendingTransition(R.anim.animation_activity_none, R.anim.animation_activity_none);
Question:
Is it some kind of new restrictions for Oreo (i.e. feature), or platform bug, or maybe the application issue? Are there any other solutions?
[UPDATE]
One more finding. Make sure you call Activity finish() and overridePendingTransition() pair on the main thread! Otherwise thread race happens and overridePendingTransition not applied sometimes.
[UPDATE]
Google has confirmed it's a bug in Android 8.0, presumably fixed in 8.1. So the "empty animation" fix is for years, until minSdkVersion == 27.