title: onAnimationEnd() called twice
body: <p>After updating the build sdk 27 from 23 came across this issue of onAnimationEnd firing twice in the code below when called. onAnimationStart is called only once and onAnimationRepeat is not called as expected. Now in the app when the user presses the back button one time, they are taken two steps back.</p>
  
  <p>All the libraries in gradle are using 27.0.2 which is the latest. This code used to work fine in sdk 23. Our min target is 16. </p>
  
  <p>I'm using a work around by using a isAnimating flag but would like to find the underlying cause which could be affecting other areas of the app.</p>
  
  <pre><code>@Override
  public void onBackPressed() {
          Animation slideOutRightAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_out_right);
          slideOutRightAnimation.setFillAfter(true);
          slideOutRightAnimation.setAnimationListener(new AnimationListener() {
              @Override
              public void onAnimationStart(Animation animation) {
                  isAnimating = true;
              }
  
              @Override
              public void onAnimationRepeat(Animation animation) {
              }
  
              @Override
              public void onAnimationEnd(Animation animation) {
                  if(isAnimating) { // Fix
                      getSupportFragmentManager().popBackStackImmediate();
                  }
                  isAnimating = false;
              }
          });
          fragmentToPopView.clearAnimation();
          fragmentToPopView.startAnimation(slideOutRightAnimation);
  </code></pre>