OverridePendingTransition not working

Found that some people ask the same thing, but the solutions did not work for me.

I do not see the animation.

The call this way:

Intent intent = new Intent(this, MyActivity.class);
startActivity(intent);
overridePendingTransition(R.anim.fadein, R.anim.fadeout);

fadein.xml and fadeout.xml are in the animation folder:

fadein.xml:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

    <alpha
        android:duration="1000"
        android:fromAlpha="0.0"
        android:interpolator="@android:anim/accelerate_interpolator"
        android:toAlpha="1.0" />
</set>

fadeout.xml:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">

  <alpha
      android:duration="1000"
      android:fromAlpha="1.0"
      android:interpolator="@android:anim/accelerate_interpolator"
      android:toAlpha="0.0" />

</set>

Use min. API 7:

manifest:

<uses-sdk android:minSdkVersion="7"/>

API 7 is also located in the project.properties file:

target=android-7

What am I doing wrong?

PD Deleting lines using the interpolator does not change anything.

Already seen / tried:

overridePendingTransition not working

overridePendingTransition does not work when using FLAG_ACTIVITY_REORDER_TO_FRONT

Fade in Activity from previous activity in Android

Fade in Activity from previous activity in Android

Android Activity Transition

+5
source share
4 answers

, , , Samsung Galaxy, . .

+16

, > :

enter image description here

.

+13

Samsung (, ), " " "- > - > ", " "

+3
source

The problem that can happen to you for the animation does not work, because your current activity is different from the next activity that you intend to do. And instead, to make an animation, it destroys the current activity, and therefore the animation does not appear, make sure that both of your actions are in the same orientation.

0
source

All Articles