how apply animation on imageview
<p>i wrote this code but it gives fatal exception as a result,i handled all exceptions,what is the reason for this.and how to apply animation on imageview ?</p>

<p><strong>main activity</strong></p>

<pre><code>public class AnimViewActivity extends Activity {
    /** Called when the activity is first created. */
   Button b;
   ImageView iv;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        b=(Button)findViewById(R.id.but);
        try{
        b.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                iv=(ImageView)findViewById(R.id.im);
                iv.setVisibility(ImageView.VISIBLE);
                iv.setBackgroundResource(R.drawable.ic_launcher);
                iv.startAnimation(new Anmatam());
            }
        });
        }
        catch(Exception e){
            e.printStackTrace();
        }
    }
}
</code></pre>

<p><strong>animation</strong> </p>

<pre><code>public class Anmatam extends Animation {
float centerx,centery;
    @Override
    protected void applyTransformation(float interpolatedTime, Transformation t) {
        // TODO Auto-generated method stub

        super.applyTransformation(interpolatedTime, t);
        try{
        Matrix mt=t.getMatrix();
        mt.setScale(interpolatedTime, interpolatedTime);
        mt.preTranslate(-centerx,-centery);
        mt.postTranslate(centerx, centery);
        }
        catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }
    }

    @Override
    public void initialize(int width, int height, int parentWidth,
            int parentHeight) {
        // TODO Auto-generated method stub
        super.initialize(width, height, parentWidth, parentHeight);
        try{
        centerx=width/0.2f;
        centery=height/0.2f;
        setDuration(2000);
        setFillAfter(true);
        setInterpolator(new LinearInterpolator());
        }
        catch(Exception e){
            e.printStackTrace();
        }
    }

}
</code></pre>

<p><strong>manifest</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.my.net.pro"
    android:versionCode="1"
    android:versionName="1.0" &gt;

    &lt;uses-sdk android:minSdkVersion="10" /&gt;

    &lt;application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" &gt;
        &lt;activity
            android:name=".AnimViewActivity"
            android:label="@string/app_name" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;

                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;activity android:name=".Anmatam"&gt;
             &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;

                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;

            &lt;/activity&gt;
    &lt;/application&gt;

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