title: How to animate an adding of a view in Android?
body: <p>I would like to know if there is a simple way to add a view (a button) to a RelativeLayout, with some kind of scale animation.
  I extended a class from Button and did something like this:</p>
  
  <pre><code>    public class MyButton extends Button {
  
      @Override
      protected void onAttachedToWindow() {
          super.onAttachedToWindow();
          ScaleAnimation anim = new ScaleAnimation(0,1,0,1);
          anim.setDuration(1000);
          anim.setFillAfter(true);
          this.startAnimation(anim);
      }
  </code></pre>
  
  <p>Then tried to add this button to a view and it didn't work. Please help!</p>