@Overridepublic boolean OnTouch (View V, motionevent event) {Createvelocitytracker (event); switch (Event.getaction ()) { Case MotionEvent.ACTION_DOWN:xDown = Event.getrawx (); Break;case MotionEvent.ACTION_MOVE:xMove = EVENT.GETRAWX ();// The active distance int distancex = (int) (xmove-xdown);//Get Shun time speed int xspeed = getscrollvelocity ();// Returns to the previous activityif (Distancex > Xdistance_min && xspeed > Xspeed_min) When the sliding distance is greater than the minimum distance we set and the instantaneous speed of the slide is greater than the speed we set {finish ();//Set Toggle animation, enter from the right, exit//overridependingtransition on the left (R.anim.in_from_left, r.anim.out_to_right);} else {return false;} Break;case MotionEvent.ACTION_UP:recycleVelocityTracker (); break;default:break;} Return false;//returns false to respond to the Click event}
<span style= "FONT-SIZE:24PX;" ><strong> in the end, return false to respond to the Click event, perfect resolution for handling event conflict issues!!!!! </strong></span>
Android: Perfect solution to the Setonitemclicklistener and Setontouchlistener conflict issues in the ListView