overridePendingTransition doesn't work if android:windowIsTranslucent is set to true on Android 11

Viewed 196

I have an Activity which has a translucent background, in the theme I have:

<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@color/transparent</item>

When the Activity is closed I use:

finish();
overridePendingTransition(R.anim.scale_fade_in, R.anim.slide_out_right);

This works fine on any Android version up to Android 10. However, on a device running Android 11 the Activity simply closes and no animation is run.

If I set android:windowIsTranslucent to false in the theme the transition works correctly but I obviously lose the translucent background I need.

Has anyone found a solution to this?

0 Answers
Related