guys. I have this code (asyncTask)
my animation ():
public void animation() { int currentRotation = 0; anim = new RotateAnimation(currentRotation, (360*4), Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f); currentRotation = (currentRotation + 45) % 360; anim.setInterpolator(new LinearInterpolator()); anim.setDuration(4000);
Can someone tell me that this is possible to do without anim.setDuration ???? just start .. and when I clicked on a button (for example), the animation stopped. Please help me. Regards, Peter.
final code:
public void animation() { int currentRotation = 0; anim = new RotateAnimation(currentRotation, (360*4), Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f); currentRotation = (currentRotation + 45) % 360; anim.setInterpolator(new LinearInterpolator()); anim.setDuration(4000);
and somewhere refresh.clearAnimation(); to stop the animation, it works perfect for me .. if something is wrong here, please tell me. Anyway, thanks for the answers :)
source share