title: Android Image zooming animation
body: <p>I'm doing an android application which has image zooming animation control with start &amp; stop buttons.(i.e)I've two buttons with an image.when i click start,the image should do zooming animation.when i click stop,it should stop animation.,and again if i click start,it should resume zooming from the stopped position.How could i do that?
   Below is my working sample code:</p>
  
  <p>ImageView imageView;
      ScaleAnimation zoom;
      Animation animset;
      float gg;</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      zoom = new ScaleAnimation(0, 1, 0, 1);
      zoom.setDuration(3000);
  
      imageView = (ImageView) findViewById(R.id.imageView1);
      imageView.startAnimation(zoom);
  
      ((Button) findViewById(R.id.start)).setOnClickListener(this);
      ((Button) findViewById(R.id.stop)).setOnClickListener(this);
  
  }
  
  @Override
  public void onClick(View v) {
      switch (v.getId()) {
      case R.id.start:
          zoom.setDuration((long) gg);
          zoom.start();
  
          break;
      case R.id.stop:
          gg = zoom.getDuration();
          break;
  
      }
  
  }
  </code></pre>
  
  <p>}
  Thanks.</p>