title: How to attach an animation to an object in layout XML in Android?
body: <p>I've got an animation defined in an XML resource, and I want to attach that animation to a view. I know how to perform this in code manually, but I was wondering if it's possible to attach that animation to a view directly in layout declaration. Something like:</p>
  
  <pre><code>&lt;ImageView android:animation="@anim/my_anim" /&gt;
  </code></pre>
  
  <p>So that animation will autoplay without any external code invocation. Is this possible with the built-in Android SDK (I'm not looking for some external library that can add this as a drop-in functionality)? If yes, how?</p>