title: Change XML Animation android to dynamic code
body: <p>I have this Animation:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"
      android:interpolator="@android:anim/decelerate_interpolator"&gt;
      &lt;scale android:fromXScale="1.0" android:toXScale="2.0"
      android:fromYScale="1.0" android:toYScale="2.0"
      android:pivotX="50%p" android:pivotY="50%p"
      android:duration="2000" /&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>But i have to make it dynamic in my code:</p>
  
  <pre><code>AnimationSet animSet = new AnimationSet(false);
  animSet.setInterpolator(AnimationUtils.loadInterpolator(AddPhoto.this,
       android.R.anim.decelerate_interpolator));
  ScaleAnimation zoom = new ScaleAnimation(1.0f, 1.0f, 2.0f, 2.0f);
     zoom.setDuration(2000);
    animSet.addAnimation(zoom);
  </code></pre>
  
  <p>But it's not the same, what did i do wrong? Thanks.</p>