I have added onLongclickListner and onTouchListner to LinearLayout. In onTouch() function I have to return true because I have added onGestureDetecter inside the ontouchListner for capturing single and double taps. onTouchListner and OnGestureListner is working perfectly but onLongclickListner is not working.
I have added onLongclickListner and onTouchListner to LinearLayout . In onTouch() function I have
Share
Usually
OnTouchListenerintercepts all touch events (also tap, click and etc). WhenOnTouchListenerintercepts event he returns true ononTouch()method.So you should return
falseinonTouch()in your appropriate circumstances. Then android framework is invokedonLongClick() inOnLongClickListener.Or use
OnClickListenerinsteadOnTouchListener