overridePendingTransition not working in Android

android, animation

Solution

I made it work out in the following way.

I have removed the

overridePendingTransition(R.anim.slide_up,R.anim.slide_up);

from the above code and placed it in `onPause()`, and it worked like a charm.

Problem

The following code is not working for me. ``` finish(); overridePendingTransition(R.anim.slide_up,R.anim.slide_up); startActivity(intent); overridePendingTransition(R.anim.slide_up,R.anim.slide_up); ``` and the XML for animation is ``` <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromXDelta="50%p" android:toXDelta="-50" android:duration="@android:integer/config_mediumAnimTime"/> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="@android:integer/config_mediumAnimTime" /> </set> ``` I searched the web, saw all the threads from Stack Overflow, but not able to fix this.

Original source