I'd like to disable the (new) Android Lint warning 'The resource Xxx appears to be unused' for some specific resources.
For other Lint warning I was ableto take advantage of Quick Assist, which showed 3 choices to disable the warning, one of those was for that particular file.
But this warning does not show any Quick Assist, it appears in Eclipse with the generic yellow warning color on top of a file (the one defining the resource).
I tried also manually editing the lint.xml file like in the following:
<lint> <issue id="UnusedResources"> <ignore path="res\layout\my_layout.xml" /> </issue> <lint>
but with no luck (I picked up the id from an Android Lint reference here).
I had this problem today and found the Improving Your Code with lint page to be very helpful. In the "Configuring lint checking in XML" section, it describes how to ignore specific resources:
You can use the
tools:ignore
attribute to disable lint checking for specific sections of your XML files. In order for this attribute to be recognized by the lint tool, the following namespace value must be included in your XML file:namespace xmlns:tools="http://schemas.android.com/tools"
Then you are able to add tools:ignore="UnusedResources"
to the resources to ignore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With