android - 我可以在 string.xml 中的字符串资源中使用字符串资源吗?

标签 android xml string resources

正如标题所说,我的问题是我不知道是否/如何在 string.xml 中的字符串资源中使用字符串资源。

<string name="projectname">Include Test</string>
<string name="about">@string/projectname is to test if you can use a String Resource in a String Resource</string>

我的问题是有没有人知道我是否会写

<string name="identifier">@string/other_identifier</string>

因为 Eclispe 说

error: Error: No resource found that matches the given name (at 'other_identifier' with value '@string/other_identifier eingeben...').

最佳答案

最好在运行时构建这些 String。在 String.format 的帮助下将不同的 String 资源组合在一起。

更多详情:http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling

关于android - 我可以在 string.xml 中的字符串资源中使用字符串资源吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7245743/

相关文章:

c++ - ctypes 中的 "char *pList"

Java 添加到 arrayList 中已有的元素

Android:从对话框 fragment 调用 onActivityResult()

java - 解析 JSON 时出现错误

android - 一个典型的 Android 应用程序使用多少内存是合理的

java : finding absolute xpath of specific node

java - Solaris 上的 StackOverflowError 但 Linux/Windows 上没有

C# 如何能够像 TeXT 一样放置 "text"并且它仍然运行 If

java - 应用程序包中类的 NoClassDefFoundError

xml - Jaxb - 覆盖 XMLElement 名称属性