Receiving onTouch and onClick events with Android

后端 未结 7 1034
滥情空心
滥情空心 2020-12-16 04:02

I have a view that need to process onTouch gestures and onClick events. What is the proper way to achieve this?

I have an onTouchListener and

7条回答
  •  执笔经年
    2020-12-16 04:50

    I agree with jdx, if you use onTouchlistener you dont need to use onclicklistener and viceversa, if you want to trigger an event on button,image,or textview click, then just fire onClicklistener. if you want some animations like dragging and spinning then use ontouchlistener to get the coordinates of the surface touched

提交回复
热议问题