I'd like to create a infinity loop when I push a button and stop it when I release the button, so I create this, but it doesn't stop when I release the button... can you help me?
public boolean onTouch(View v, MotionEvent event) {
if(event.getAction() == MotionEvent.ACTION_DOWN) {
if (v.getId() == R.id.up) {
for(;;){
//make my action
if(event.getAction() == MotionEvent.ACTION_UP) {
break;
}
}
}
}
return false;
}
}