简体   繁体   English

在OnItemLongClick之前未调用OnTouchEvent

[英]OnTouchEvent is not called before OnItemLongClick

In my DynamicListView class, I need to handle two events: onTouchEvent and OnItemLongClick event. 在我的DynamicListView类中,我需要处理两个事件:onTouchEvent和OnItemLongClick事件。 My expectation is that the onTouchEvent is called before the OnItemLongClick event. 我的期望是在OnItemLongClick事件之前调用onTouchEvent。 However, this is not the case. 然而,这种情况并非如此。 The OnItemLongClick event is handled without any call to the OnTouchEvent. OnItemLongClick事件的处理无需调用OnTouchEvent。 Is there anyway to specify the order of these handlers ? 无论如何,有没有指定这些处理程序的顺序? I need to get the coordinates of the touch event first before handling the OnItemLongClick event. 在处理OnItemLongClick事件之前,我需要先获取touch事件的坐标。

尝试在DynamicListView重写dispatchTouchEvent(MotionEvent ev)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM