添加机器人绘制菜单的XML应用程序停止编译 [英] Adding android drawable to menu XML stop app compiling

查看:337
本文介绍了添加机器人绘制菜单的XML应用程序停止编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个机器人项目,并有操作栏菜单中选择一个XML文件,对其进行了工作正常,但我现在需要有一个图标添加一个额外的项目,但是这将显示在Eclipse标签错误并控制台输出。如果我删除图标领域,那么它的罚款,但如果我添加图标,然后我得到的错误。

I am working on an android project and have an XML file for the action bar menu, its been working fine, but I now need to add an extra item with an icon, but it this displays an error in the eclipse tab and the console output. If I remove the icon field, then its fine, but if I add the icon, then I get the error.

下面是包含该菜单项的XML。我已经包含一个项目是previously工作,新项目不工作

Below is the XML that contains the menu item. I've included one item that previously worked and the new item that isn't working

<item android:id="@+id/mnu_search"
        android:title="Search"
        android:icon="@android:drawable/ic_menu_search"
        android:showAsAction="always">
    </item>
    <item android:id="@+id/mnu_sync"
        android:title="Sync"
        android:icon="@android:drawable/ic_menu_refresh"
        android:showAsAction="always">
    </item>

同步菜单项不工作,搜索项工作的罚款之一。

The sync menu item is the one that isn't working, the search item is working fine.

在Eclipse中的错误选项卡中的错误说:

The error in the errors tab in eclipse says

Unparsed aapt error(s)! Check the console for output

下面是控制台输出

Below is the console output

W/ResourceType( 9156): Bad XML block: header size 305 or total size 0 is larger than data size 0
C:\Users\Chris\workspace\AndroidPasswordManager\res\menu\main_menu.xml:13: error: Error: Resource is not public. (at 'icon' with value '@android:drawable/ic_menu_refresh').
W/ResourceType( 8896): Bad XML block: header size 300 or total size 0 is larger than data size 0
C:\Users\Chris\workspace\AndroidPasswordManager\res\menu\main_menu.xml:13: error: Error: Resource is not public. (at 'icon' with value '@android:drawable/ic_menu_refresh').
W/ResourceType( 8984): Bad XML block: header size 303 or total size 0 is larger than data size 0
C:\Users\Chris\workspace\AndroidPasswordManager\res\menu\main_menu.xml:13: error: Error: Resource is not public. (at 'icon' with value '@android:drawable/ic_menu_refresh').

我不知道什么可能是错误的。我已经办理登机手续的图像Android SDK的目录,它definetely存在,我使用API​​级15。

I have no idea what could be wrong. I've check in the android sdk directory for the images and it definetely exists, I'm using api level 15.

感谢您的帮助,您可以提供。

Thanks for any help you can provide.

推荐答案

您正在尝试的资源使用不公开。它在内部使用Android系统。使用你的应用程序绘制的参考。

The resource you are trying to use not public. It is used by android internally. Use your app drawable reference.

这篇关于添加机器人绘制菜单的XML应用程序停止编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆