在 sl4a 中使用 addContextMenuItem

发布于 2025-01-07 06:53:42 字数 535 浏览 1 评论 0原文

如何在 sl4a 中使用 addContextMenuItem

我使用实验性全屏 UI 来显示列表视图。我想要:
1) 长按列表中的某个项目
2)显示与该项目相关的选项的“弹出”菜单。

列表视图部分工作正常。

我知道如何执行 2) 一旦收到事件(只需显示警报并添加项目),但我无法看到哪些用户操作实际触发了您定义的事件,或者如何控制它。

例如,什么会触发下面定义的“Play”事件,以及我如何控制什么?

droid.addContextMenuItem("Play", "contextmenu", "test")

How do you use addContextMenuItem in sl4a?

I'm using the experimental full-screen UI to display a list view. I want to:
1) trap a long-press on an item on the list
2) show a "pop-up" menu of options relating to that item.

The listview part works fine.

I know how I can do 2) once I get an event (simply display an alert and add items) but I can't see what user action actually triggers the event you define, or how to control it.

E.g. what will fire the "Play" event defined below, and how do I control what does?

droid.addContextMenuItem("Play", "contextmenu", "test")

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文