android - How to Stop OnTouchListener while user is touching the screen? -


I am looking for a way to force the user to increase my finger before the next action. I have a situation when the user chooses something on the scene and I do not want to open it again again and again without lifting your finger.

This is my basic question:

Enter image details here

option 1:

Set OnClickListener instead of OnTouchListener.

Option 2:

Hold ACTION_UP and then apply your action only.

Boolean Press Flag = Wrong; Public Boolean On-Touch (see V, Motion Event Event) {int action = event.getAction (); Switch (Action) {Case MotionEvent.ACTION_DOWN: if (pressFlag == incorrect) {// Press Your Action Flag == True; } Else {// nothing} break; Case Motion Event Action_UP: Press Flag == Wrong; break; Default: Break; } Back true;

}


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

How to access user directory in lazarus? -

java - Gradle dependencies: compile project by relative path -