strings.xml android 中重复的字符串资源

kis*_*idp 5 xml android

Android 中还有其他方法检查重复的字符串资源吗?

假设我有这两个字符串:

<!-- some other strings -->
<string name="A">I'm A</string>
<string name="A">I'm A</string>
<!-- some other strings -->
Run Code Online (Sandbox Code Playgroud)

在我的 Eclipse 中,这不会导致任何错误或警告,即使我尝试使用 lint,它也不会显示。那我怎么能看到这样的问题呢?

Gil*_*yof 4

在日食中:

  1. 打开您的项目属性
  2. 选择 Android Lint 首选项
  3. 确保选择了 DuplicateDefinition 标志。

每当您的资源文件之一中有重复资源时,就会弹出一条警告。

希望这可以帮助 :)