Does using overridePendingTransition disappear the caller activity when activity “activity” appears in Android Kitkat?

How can i stop this? The calling activity disappears when a new activity pops up when using overridePendingTransition. I use overridePendingTransition to animate on older devices. I just need to terminate the caller activity, like what I did on LOLLIPOP devices.

if (Build.VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { Window window = activity.getWindow(); window.setExitTransition(null); } 

Please note that this only happens on Android Kitkat 4.4. I tried to get the scene for the whole layout action, and then set exitAction to zero, but that didn't work.

How can i do this?

+6
source share
1 answer

I found the answer to this problem just now.

It seems that my theme attributes ruined the animation. To solve this problem, 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 correctly on Kitkat, and I tested other APIs, and it still works as expected. Hope this helps someone else solve this problem.

+5
source

All Articles