Creating animation at runtime in Android
<p>i can use an XML file like below</p>

<pre><code>&lt;set xmlns:android="http://schemas.android.com/apk/res/android" 
     android:interpolator="@android:anim/decelerate_interpolator"&gt;

 &lt;translate android:fromXDelta="100%" android:toXDelta="0%" android:duration="500" /&gt;

&lt;/set&gt;
</code></pre>

<p>and load this xml from code like
AnimationUtils.loadAnimation(mContext, com.....R.anim.slidein)</p>

<p>everything works fine</p>

<p>But now for some reason i need to do that same thing without using XML
how do i create the same animation using just code 
i tried something like this</p>

<pre>
TranslateAnimation in = new TranslateAnimation(1.0f,0.0f,0.0f,0.0f);


    in.setInterpolator(AnimationUtils.loadInterpolator(mContext,
                        android.R.anim.accelerate_interpolator));

    in.setDuration(500);
</pre>

<p>but didnt work, nothing animates</p>

<p>i think the problem is with percentages, in the xml i have specified percentages but in the TranslateAnimation constructor how do i specify percentages</p>
