I have an activity that appears as a dialog using the following custom theme:
<style name="ThemeDialogNoAnimation">
<item name="android:windowAnimationStyle">@null</item>
<item name="android:windowEnterAnimation">@null</item>
<item name="android:windowExitAnimation">@null</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsFloating">true</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
Notice I have no animations set, yet when the activity exists is still slides to the right. How do I stop it from animating?
The animations you’re seeing most likely come from the system but they’re easy to override.
If you want no transition when the activity starts:
If you want no transitions when the activity finishes:
Passing in 0 when overriding transitions signals to the system to use no transitions. In place of 0 you could also add in a custom transition of your own by passing in the resource identifier to an animation resource.