Note that there are some explanatory texts on larger screens.

plurals
  1. POoverridePendingTransition shows enter animation only
    primarykey
    data
    text
    <p>When the user changes the language locale, I would like to reload the activity with the new locale. I want to create an animated transition when finishing the Activity and starting it again. </p> <p>The transition animation is as follows:</p> <p>The exit animation is to scale the activity to the center of the screen. The enter animation is to scale the activity from the center of the screen.</p> <pre><code>finish(); overridePendingTransition(0, R.anim.scale_to_center); Intent intent =new Intent(SettingsActivity.this, SettingsActivity.class); startActivity(intent); overridePendingTransition(R.anim.scale_from_center, 0); </code></pre> <p>and my <code>scale_to_center.xml</code> is:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;scale android:fromYScale="1.0" android:toYScale="0" android:fromXScale="1.0" android:toXScale="0" android:pivotX="50%" android:pivotY="50%" android:duration="500"/&gt; &lt;/set&gt; </code></pre> <p>and my <code>scale_from_center.xml</code> is:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;scale android:fromYScale="0" android:toYScale="1.0" android:fromXScale="0" android:toXScale="1.0" android:pivotX="50%" android:pivotY="50%" android:startOffset="500" android:duration="2000"/&gt; &lt;/set&gt; </code></pre> <p>The problem is that ONLY the enter transition appears and the exit transition do not appear. I tried to add a delay to the exit transition but it didn't work either.</p> <p>However when I changed the code to only animate the exit of application. It worked.</p> <pre><code>finish(); overridePendingTransition(0, R.anim.scale_to_center); </code></pre> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload