title: Android rotate imageview, i cant set the final position of imageview in onAnimationEnd()
body: <p>I want to rotate an imageview from 30 degrees on each click on a button.</p>
  
  <p>On the first clic, i can set the animation properly but i can't succeed to update the imageview position after the animation. When i clicked again on the button, the animation start from the original position of the imageview and not from the final position after the first animation.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      turnImg = (ImageView) findViewById(R.id.imageViewturnImg );
      Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.imgTurn);
      // Getting width &amp; height of the given image.
      int w = bmp.getWidth();
      int h = bmp.getHeight();
  
      turnImg .setImageBitmap(bmp);
  
      Button buttonok = (Button) findViewById(R.id.buttonok);
      buttonok.setOnClickListener(new OnClickListener() {
          public void onClick(View v) {
              turn();
          }
      });
  
  }
  
  public void turn()
  {
      float degrees = 30; 
  
      RotateAnimation anim = new RotateAnimation(0, degrees,Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
      anim.setInterpolator(new LinearInterpolator());
      anim.setDuration(300);
      anim.setFillEnabled(true);
  
      anim.setFillAfter(true);
  
      anim.setAnimationListener(new AnimationListener() {
          @Override
          public void onAnimationEnd(Animation arg0) {
  
          Matrix mat = turnImg.getImageMatrix();
              mat.postRotate(30,turnImg.getWidth()/2, turnImg.getHeight()/2);
              turnImg.setScaleType(ScaleType.MATRIX);
              turnImg.setImageMatrix(mat);
  
          }
  
          @Override
          public void onAnimationRepeat(Animation animation) {}
          @Override
          public void onAnimationStart(Animation animation) {}
      });
  
  
      turnImg.startAnimation(anim);
  
  }
  </code></pre>
  
  <p>I think the problem came from the way i actualize the position in the onAnimationEnd().</p>
  
  <p>ps : sorry for my bad english...</p>