Android TOUCH_MOVE事件未在avd或设备中触发

时间:2010-09-30 04:09:21

标签: android events touch

事实上,只会发生touch_down事件。基本上,我正在尝试在我的应用中实现拖动功能,因此我需要touch_move事件。我有一个方法可以将触摸事件写入Eclipse中的LogCat,但touch_down是唯一显示的事件。甚至不显示touch_up。我在设备上或在avd中调试时遇到此问题。

这不是一个真正的代码问题。但有没有人有问题让不同的触摸事件发生?如果是这样,你是如何解决它们的?我正在使用最新的Android SDK和Eclipse版本。我正在使用一个简单的ImageView。

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

因此,在处理TouchEvent时,您需要小心。The important thing is that this event can have multiple actions that follow each other. So, if you return false when the down action event is received, you indicate that you have not consumed the event and are also not interested in subsequent actions from this event. Thus, you will not be called for any other actions within the event, such as a finger gesture, or the eventual up action event.有关详细信息,请阅读documentation