Java 如何使用android Studio为android资源值创建自定义类型
我在eclipse中有一个自定义资源值 文件名为 errors.xml 在errors.xml中,我们有Java 如何使用android Studio为android资源值创建自定义类型,java,android,xml,resources,Java,Android,Xml,Resources,我在eclipse中有一个自定义资源值 文件名为 errors.xml 在errors.xml中,我们有 <?xml version="1.0" encoding="utf-8"?> <resources> <item name="hello_1" type="errors">hello message 1</item> <item name="hello_2" type="errors">hello message 2
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="hello_1" type="errors">hello message 1</item>
<item name="hello_2" type="errors">hello message 2</item>
<item name="hello_3" type="errors">hello message 3</item>
</resources>
你好消息1
你好,留言2
你好,留言3
在eclipse中,我可以通过
使用stringerrormessage=getString(R.errors.hello\u 1)
我正在尝试将我的项目迁移到Android Studio。然而,它却在抱怨我在errors.xml资源中的错误
错误:任务“:app:mergeDebugResources”的执行失败
文件/Users/xiaowoo/project/migrate\u android\u studio/someapp/app/src/main/res/values/errors.xml中不支持的类型“errors”
Android Studio只是不喜欢自定义类型,type=“errors”
,
它允许我将类型设置为string
,colors
,dimen
,但不能设置为errors
(我的自定义类型)
有没有办法解决这个问题?附近有步行街吗
谢谢,如有任何意见和建议,我们将不胜感激 抱歉,这不会有多大帮助,但我可以确认我看到了同样的事情。我认为这一定是Eclipse的一个特性,而不是android本身,似乎从来没有这样的特性。这是一种耻辱,因为能够以这种方式对资源进行分组是非常好的。