Stop animation on button click over image
<p>I am adding the animation to the imageview and I would like that to stay in that animated state till the time button is pressed on button press move it to the previous state 
here is my code, using setFillAfter don't let it to restore and setting it to false it don't stay in the animated state </p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        i=(ImageView)findViewById(R.id.imageView1);
        d=(Button)findViewById(R.id.button1);
        a=new AnimationSet(false);
        ScaleAnimation s=new ScaleAnimation(0, 2, 0, 2);
        TranslateAnimation t=new TranslateAnimation(0, 100, 0, 0);

        a.addAnimation(s);
        a.addAnimation(t);
        a.setRepeatCount(0); 
        a.setDuration(500);     
        a.setFillAfter(false);

        a.setInterpolator(new AccelerateDecelerateInterpolator()); i.clearAnimation();

        d.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub

            i.clearAnimation();
            }
        });

        i.setOnTouchListener(new OnTouchListener() {

            @Override
            public boolean onTouch(View v, MotionEvent event) {
                // TODO Auto-generated method stub

                i.startAnimation(a);
                System.out.println("OnTouch called&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;");
                return false;
            }
        });
    }
</code></pre>
