Android 制作区分大小写的菜单选项
我想要的是从具有对象列表的菜单中转到,如果您选择选项菜单,则应该出现另一个列表。
我找到的例子似乎是针对列表视图或网络视图的。
还有另一种方法可以从菜单选项中进行选择吗?
I want is a go from a menu that has a list of objects, if you select an option menu another list should appear.
The examples I found seemed to be for listview or webview.
There another way to make a selection from menu options?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因此,如果我理解您的权利,您想要启动 Context 选项菜单中的菜单。你不应该这样做。来自安卓文档:
您永远不会在选项菜单项上“长按”。人们只是不习惯这样做。
尝试启动另一个活动或使用对话框。
So if I'm understanding your right, you want to launch a Context Menu from an Options Menu. You should not do this. From the android documentation:
You'd never do a "long press" on an Options Menu item. People just aren't used to doing that.
Try launching another activity instead or using a dialog.
如果您心中有固定的选项列表,您可能会寻找子菜单,其解释如下: http://developer.android.com/guide/topics/ui/menus.html
如果您希望使用适配器动态构建选项列表,您可能会发现AlertDialog.Builder 与其
setAdapter
一起使用方法。If you have a fixed list of options in mind you might be looking for submenus, which are explained here: http://developer.android.com/guide/topics/ui/menus.html
If you are looking to dynamically build a list of options with an adapter you might find AlertDialog.Builder useful along with its
setAdapter
method.