title: Recursive entry to executePendingTransactions while using PageTransformer
body: <p>I'm using a ZoomOutPageTransformer straight from the tutorial <a href="http://developer.android.com/training/animation/screen-slide.html#pagetransformer" rel="nofollow">here.</a> I have a navigation drawer and the first item on the drawer is a ViewPager Fragment. This works fine on the first try but after I move to another activity and come back, it throws this error:</p>
  
  <pre><code>06-29 21:38:06.567    5905-5905/com.hidden.hidden E/AndroidRuntime﹕ FATAL EXCEPTION: main
      Process: com.hidden.hidden, PID: 5905
      java.lang.IllegalStateException: Recursive entry to executePendingTransactions
              at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1456)
              at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:482)
              at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:163)
              at android.support.v4.view.ViewPager.populate(ViewPager.java:1073)
              at android.support.v4.view.ViewPager.populate(ViewPager.java:919)
              at android.support.v4.view.ViewPager.setPageTransformer(ViewPager.java:623)
              at com.hidden.hidden.MyFragment.onActivityCreated(MyFragment.java:56)
              at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:1512)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:962)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1121)
              at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
              at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1484)
              at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:450)
              at android.os.Handler.handleCallback(Handler.java:733)
              at android.os.Handler.dispatchMessage(Handler.java:95)
              at android.os.Looper.loop(Looper.java:136)
              at android.app.ActivityThread.main(ActivityThread.java:5001)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:515)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
              at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <h1>My Code</h1>
  
  <p>onActivityCreated() in MyFragment.java</p>
  
  <pre><code>@Override
  public void onActivityCreated(Bundle savedInstanceState) {
      super.onActivityCreated(savedInstanceState);
  
      mPager = (ViewPager) getView().findViewById(R.id.pager);
      mPager.setAdapter(new MyCustomAdapter(getFragmentManager()));
  
      //Line 56
      mPager.setPageTransformer(true, new ZoomOutPageTransformer());
  
      mIndicator = (LinePageIndicator) getView().findViewById(R.id.indicator);
      mIndicator.setViewPager(mPager);
  }
  </code></pre>
  
  <p>ZoomOutPageTransformer.java</p>
  
  <pre><code>public class ZoomOutPageTransformer implements ViewPager.PageTransformer {
      private static final float MIN_SCALE = 0.85f;
      private static final float MIN_ALPHA = 0.5f;
  
      public void transformPage(View view, float position) {
          int pageWidth = view.getWidth();
          int pageHeight = view.getHeight();
  
          if (position &lt; -1) { // [-Infinity,-1)
              // This page is way off-screen to the left.
              view.setAlpha(0);
  
          } else if (position &lt;= 1) { // [-1,1]
              // Modify the default slide transition to shrink the page as well
              float scaleFactor = Math.max(MIN_SCALE, 1 - Math.abs(position));
              float vertMargin = pageHeight * (1 - scaleFactor) / 2;
              float horzMargin = pageWidth * (1 - scaleFactor) / 2;
              if (position &lt; 0) {
                  view.setTranslationX(horzMargin - vertMargin / 2);
              } else {
                  view.setTranslationX(-horzMargin + vertMargin / 2);
              }
  
              // Scale the page down (between MIN_SCALE and 1)
              view.setScaleX(scaleFactor);
              view.setScaleY(scaleFactor);
  
              // Fade the page relative to its size.
              view.setAlpha(MIN_ALPHA +
                      (scaleFactor - MIN_SCALE) /
                              (1 - MIN_SCALE) * (1 - MIN_ALPHA));
  
          } else { // (1,+Infinity]
              // This page is way off-screen to the right.
              view.setAlpha(0);
          }
      }
  }
  </code></pre>
  
  <p>Again, the transformer is straight from the Android Developer's page.</p>
  
  <p>Help is much appreciated!</p>