How do I stop this from happening? The calling activity disappears when the new acitivity "pops" in using overridePendingTransition. I am using overridePendingTransition so as to animate on older devices. I just need to stop the calling activity from disappearing like what I have done on LOLLIPOP devices
if (Build.VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
Window window = activity.getWindow();
window.setExitTransition(null);
}
Take note this only happens on Android Kitkat 4.4. I tried getting a Scene for the whole layout activity and then setting the exitAction to null but it didn't work.
How can I do this?
I found out the answer to this problem just now.
It seems like my theme attributes are messing up the animations. To solve this I had to set the following attributes:
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowIsFloating">true</item>
which were originally:
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowIsFloating">false</item>
After that, it worked properly on Kitkat and I tested on the other APIs and it still works as expected. I hope this helps someone else solving this issue
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