开发者

Android - ListView fling gesture triggers context menu

I'm relatively new to Android development. I'm developing an app with a ListView. I've followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, it pulls up the context menu for the item. I 开发者_如何学Gojust want the fling action to be handled in code (my app does one list per date and I want to use the fling gesture to move back and forth in days). Does anyone know how to suppress the context menu if the gesture is recognized?

Thanks, Jason


Check the return value in your overrided onFling method.

You need to return "true" in order to consume the event, if you do not consume the fling event, it will be passed back up through the android system and possibly trigger other events such as the onLong (context menu) event.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜