title: Screen flicker while fragment transition
body: <p><a href="https://i.stack.imgur.com/3FZWT.gif" rel="noreferrer">Here is the link to recording while pressing back button</a></p>
  
  <p>While i am using a animation in a fragment transaction it's working fine but i am getting a flicker of the next screen which is annoying me. I have been searching for it since 2 days no progress.</p>
  
  <p>I am using this code for transition</p>
  
  <pre><code>public void moveToBaseSelect() {
      FragmentTransaction ft = fragmentManager.beginTransaction();
      ft.setCustomAnimations(R.anim.enter_from_right,R.anim.exit_to_left,R.anim.enter_from_left,R.anim.exit_to_right);
      ft.replace(R.id.home_frame, new BaseSelectFragment(), HomeActivity.BASE_SELECT);
      ft.addToBackStack(HomeActivity.BASE_SELECT);
      ft.commit();
  
  }
  
  public void moveToLogin()
  {
      if(fragmentManager.getBackStackEntryCount()&gt;=1 &amp;&amp; fragmentManager.getBackStackEntryAt(fragmentManager.getBackStackEntryCount()-1).getName().equals(HomeActivity.LOGIN))
          return;
  
      FragmentTransaction ft = fragmentManager.beginTransaction();
      ft.setCustomAnimations(R.anim.enter_from_right,R.anim.exit_to_left,R.anim.enter_from_left,R.anim.exit_to_right);
      ft.replace(R.id.home_frame, new LoginFragment(), HomeActivity.LOGIN);
      ft.addToBackStack(HomeActivity.LOGIN);
      ft.commit();
  }
  </code></pre>
  
  <p>The anim files</p>
  
  <p>enter from left</p>
  
  <pre><code>&lt;set&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;translate
          android:duration="500"
          android:fillAfter="true"
          android:interpolator="@android:anim/accelerate_interpolator"
          android:fromXDelta="-100%p"
          android:toXDelta="0%p" /&gt;
  &lt;/set&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>Enter from right</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;translate
          android:duration="500"
          android:fillAfter="true"
          android:interpolator="@android:anim/accelerate_interpolator"
          android:fromXDelta="100%p"
          android:toXDelta="0%p" /&gt;
  &lt;/set&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>exit to left</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;translate
          android:duration="500"
          android:fillAfter="true"
          android:interpolator="@android:anim/accelerate_interpolator"
          android:fromXDelta="0%p"
          android:toXDelta="-100%p" /&gt;
  &lt;/set&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>exit to right</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;translate
          android:duration="500"
          android:fillAfter="true"
          android:interpolator="@android:anim/accelerate_interpolator"
          android:fromXDelta="0%p"
          android:toXDelta="100%p" /&gt;
  &lt;/set&gt;
  &lt;/set&gt;
  </code></pre>
  
  <hr>
  
  <p>I have tried a alternative that's working by using animator instead of anim and app.fragment instead of v4.fragment</p>
  
  <p>But I am extremely curious to know is there any solution if i stick with the anim method </p>