title: Why does my Android transition ignore the TransitionListener?
body: <p>I'm trying to make a smoothly-updating display by calling <code>TransitionManager.beginDelayedTransition(viewGroup, new AutoTransition())</code> before updating the display. But I found that sometimes I update the display rapidly and Android gets confused.</p>
  
  <p>So I added a <code>TransitionListener</code> to the <code>AutoTransition</code> where <code>transitionEnd()</code> calls back, saying the transition is complete, at which point I animate to the new state of the screen. But I find that usually this is not even called.</p>
  
  <p>Is there some way of having a callback called back either when a) a transition ends or b) a transition never gets called in the first place?</p>
  
  <hr>
  
  <p>More information:</p>
  
  <p>I'm using Xamarin.Android. I have a section of code that looks like this which initiates the transition:</p>
  
  <pre><code>if (animated &amp;&amp; viewGroup != null &amp;&amp; Utils.Api19PlusKitkat) {
      App.Log("** Beginning animation.");
      var transition = new AutoTransition();
      transition.AddListener(new TransitionListener(this));
      TransitionManager.BeginDelayedTransition(viewGroup, transition);
  }
  </code></pre>
  
  <p>TransitionListener is pretty simple:</p>
  
  <pre><code>public class TransitionListener : Java.Lang.Object, Transition.ITransitionListener {
      readonly TreeNode owner;
  
      public TransitionListener(TreeNode owner)
      {
          this.owner = owner;
      }
  
      public void OnTransitionEnd(Transition transition)
      {
          App.Log("**** TransitionListener: Transition End.");
          owner.FinishTransition();
      }
  
      public void OnTransitionCancel(Transition transition) {}
      public void OnTransitionPause(Transition transition) {}
      public void OnTransitionResume(Transition transition) {}
      public void OnTransitionStart(Transition transition) {
          App.Log("**** TransitionListener: Transition Start.");
      }
  }
  </code></pre>
  
  <p>When I look at my application log, I see a bunch of cases of "Beginning animation" but very rare cases of "Transition Start" or "Transition End" (currently I'm not seeing any instances but sometimes I've seen it happen in the log).</p>