humazed
humazed

Reputation: 76902

suppress for fields annotation

I'm using butterknife library to my project to use Bind annotation instead of findViewById.

when I use @Bind(R.id.button) Button mButton; but never use it, android studio show me warning that I never used it and highlight it with yellow.

when I press Alt+Enter for quick fix -just exploring- and choose the secound choise

suppress for feilds annotated by 'butterkife.Bind'

the warning is gone, but then when I tried to undo what I have done it does't work what ever I tried.

I know it's small thing but it's really annoing.

Upvotes: 2

Views: 848

Answers (1)

Bryan Herbst
Bryan Herbst

Reputation: 67189

Open up your Android Studio preferences, and go to Editor > Inspections.

If you want to simply reset everything to the defaults, you can stop here and click "Reset to defaults" under the settings icon to the right of the search box.

Settings to the right of the search box

If you want to just reset the one inspection, from this list find the inspection that you want to configure. The inspections you have changed should be highlighted in blue. It sounds like you are looking for the "Unused declaration" inspection.

Depending on the inspection, you may see either a "Configure annotations..." button at the bottom of the pane to the right, or a pane that says "Additional special annotations." If you see the button, click it. From the list of annotations, click the minus sign below the pane to remove the exception for that annotation.

Configure annotations button

If you prefer editing the raw settings files, you can also find your custom inspection rules at <project>/.idea/inspectionProfiles/Project_Default.xml.

Upvotes: 4

Related Questions