在我运行Eclipse中的Lint之后,它会显示一个未使用资源列表,主要是drawable。其中有一些是不正确的。它说有一些资源没有使用,但实际上它在array.xml中被使用了。
例如:资源R.drawable.test看起来没有被使用。
在array.xml中:
<string-array name="icon">
<item>test</item>
</string-array>
然后在我的活动中,我使用以下代码检索资源。
String[] icon = getResources().getStringArray(icon);
iconRes = getResources().getIdentifier(icon[itemPos], "drawable", this.getPackageName());
我尝试在终端中运行lint,结果是一样的。
lint.xml
实现。 - Dmitry