Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
每当手势结束时,都需要调用特定的方法。目前,我正在使用 if 语句来查看 MotionEvent 是否ACTION_UP要执行此操作。但是,我发现如果我在快速滑动时抬起手指,则 MotionEvent 不是ACTION_UP,而是ACTION_MOVE。只有当我在手指不动时抬起它才能正常工作。
ACTION_UP
ACTION_MOVE
有什么建议或替代解决方案吗?
提前致谢。
编辑:问题已解决
好吧,我知道出了什么问题。当 onTouchEvent 修改我的渲染器也在绘制的对象列表时,我使用了一些布尔值来防止 ConcurrentModificationExceptions。事实证明,这在一半的时间里提前结束了该方法。我最终同步了列表,现在它工作正常。