• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps to stop animation when touch event is released

Yati

Lurker
Hi,
I am very new to this forum i am sorry if i will be a bit confusing.
I am using frame animation when my animation starts perfectly,
when i try to use(i.e MotionEvent.ACTION_MOVE) it drags my
rectangle as i want but my problem is that it does not stop the
flickering as soon as i release my touch event i want it to stop
flickering but it still continues with it.
Please help me with it.
Thanks
 
Have you tried this?

public boolean onTouch(View v, MotionEvent evento) {
if(evento.getAction() == MotionEvent.ACTION_DOWN){
your_anim.start();
}else if (evento.getAction() == MotionEvent.ACTION_UP) {
your_anim.stop();
}
return true;
}//onTouch
 
Back
Top Bottom