Implementing onItemClick and onItemLongClick on an Android GridView

后端 未结 1 722
天命终不由人
天命终不由人 2021-01-21 05:30

How do I implement onItemLongClick and onItemClick for a GridView so that GridView items respond to both events?

相关标签:
1条回答
  • 2021-01-21 05:57

    I found that the trick is in the return value of the longclick listener call back. If you return true, onclick will not be called after the longclick is called and simple click will invoke only onclick. It worked fine for me.

    0 讨论(0)
提交回复
热议问题