Android :: OnTouchListener && OnClickListener combination issue

前端 未结 3 683
慢半拍i
慢半拍i 2020-12-18 07:34

Problem description:

I have a TextView on a RelativeLayout and I want to color it red when the user touches it, and go on another page whe

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-18 08:20

    Had the same problem. Solved it by returning false from ACTION_MOVE. I've been fighting with it for few hours, trying various things, but seems like i've kept overlooking this little issue... And now it makes sense. When you return true from onTouch, futher processing is stopped, so that OnClickListener is not aware of any movements and triggers onClick even after pointer have moved outside of view.

提交回复
热议问题