Android 不允许同时使用上下文菜单和上下文菜单选项菜单?
我尝试向一项活动添加选项菜单和上下文菜单,但它不起作用。
当我在菜单文件夹中创建一个新的 XML 文件(其中存在选项菜单的 XML 文件)时,整个 Android 应用程序无法工作,因为无法再次创建/更新 R.java 文件。
为什么会发生这种情况?
有人遇到同样的问题吗?
谢谢您的回答。
i've tried to add an optionsmenu and a contextmenu to one activity, but it doesn't work.
When i create a new XML file in the menu folder, where the XML file for the optionsmenu exists, the whole android app doesn't work, because the R.java file couldn't be created/updated again.
Why this is happening?
Anybody got the same problems?
Thank you for your answers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您的某个资源文件或清单中存在错误,因此会阻止生成
R.java
。如果您使用 Eclipse,此错误通常会出现在 Console 选项卡中;如果您从命令行构建,您将看到编译错误。Because you have a bug in one of your resource files, or perhaps your manifest, that is preventing
R.java
from being generated. If you are using Eclipse, this error usually appears in the Console tab; if you are building from the command line, you will see a compile error.