Hey I am looking for a way to force the user on-touch to be cancel and force him to raise his finger again to re-choice.
This is basically my question:
set OnClickListener instead of OnTouchListener.
catch the ACTION_UP and apply your action only after it.
boolean pressFlag= false;
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
if(pressFlag==false){
// applay your action
pressFlag==true;
}else{
//do nothing
}
break;
case MotionEvent.ACTION_UP:
pressFlag==false;
break;
default:
break;
}
return true;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With