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.
我对 Android 开发比较陌生。我正在开发一个带有 ListView 的应用程序。我已经按照# 1338475中的信息让我的应用程序识别了投掷手势,但是在手势完成后,它会拉出该项目的上下文菜单。我只希望在代码中处理投掷动作(我的应用程序每个日期执行一个列表,我想使用投掷手势在几天内来回移动)。如果手势被识别,有谁知道如何抑制上下文菜单?
谢谢,杰森
检查覆盖onFling方法中的返回值。
onFling
您需要返回“true”才能消费该事件,如果您不消费fling事件,它将通过android系统传回并可能触发其他事件,例如onLong(上下文菜单)事件。
onLong