获取 onCreateContextMenu 中的行位置
我正在尝试创建一个上下文菜单,根据单击的行来更改可用选项。
但在创建菜单之前,我无法弄清楚如何获取所单击的行的列表视图中的行位置。
I'm trying to create a context menu that changes the available options depending on which row was clicked.
But I can't figure out how to get the row position in the listview for row that was clicked, until after the menu is created.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一点也不明显,但代码如下:
It is not obvious at all, but here's the code:
上述解决方案对我不起作用。这是我使用的:
The above solution did not work for me. Here is what I used: