title: Why does view.startAnimation(animation) not work when called from an event?
body: <p>I have created a custom view which uses an dummy TranslateAnimation to setup some layout properties. I use the Interpolator to calculate height, and apply it to a view inside the applyTransformation() method of the TranslateAnimation.</p>
  
  <p>This is working quite well, if i trigger the animation from my Activity.</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      Log.i("test", "onCreate()");
      view.expand(); // This method starts the animation
  }
  </code></pre>
  
  <p>When I try to do the same using a touch event, nothing happens.</p>
  
  <pre><code>@Override
  // This method is touch handler of the View itself
  public boolean onTouch(View v, MotionEvent event) {
      Log.i("test", "onTouch()");
      this.expand(); // onTouch is part of the view itself and calls expand() directly
      return true;
  }
  </code></pre>
  
  <p>My expand method looks like this:</p>
  
  <pre><code>public void expand() {
      Log.i("test", "Expand!");
  
      TranslateAnimation anim = new TranslateAnimation(0, 0, 0, 0) {
  
          @Override
          protected void applyTransformation(float interpolatedTime, Transformation t) {
              Log.i("test", "applyTransformation()");
  
              super.applyTransformation(interpolatedTime, t);
  
              // do something
          }
  
      };
      anim.setDuration(500);
      anim.setInterpolator(new AccelerateDecelerateInterpolator());
      this.someInternalView.startAnimation(anim);
  }
  </code></pre>
  
  <p>Once my activity is created Logcat shows "onCreate()"
  Inside my touch event Logcat shows "onTouch()"
  Inside the expand() method Logcat shows "Expand!" - either called from the activity or from an event.</p>
  
  <p>Inside the method applyTransformation() Logcat shows "applyTransformation()" - BUT! only if expand() is called from the onCreate(). Any attempt in trying to start the animation from an event failed. </p>
  
  <p>This looks to me like some sort of threading problem. Could this be? Is there anything I am missing? As far as I see from other posts, starting animations from events should work without any problems...</p>
  
  <p>Thanks in advance!</p>