Remove "Method is never used" warning for OnClick annotation in Android Studio

TMS picture TMS · Apr 30, 2014 · Viewed 28.2k times · Source

Sorry if this question has been asked before. I am using the Butterknife 5.0 with the latest version of Android Studio(0.5.7). How can I remove the "Method is never used" warning for methods that use the 'OnClick' Annotation of ButterKnife.I noticed that Eclipse doesnt give this warning for the 'OnClick' methods. Thanks in advance

Answer

Osvald Ivarsson picture Osvald Ivarsson · May 13, 2014

The correct way in Android Studio to suppress these warnings is to press Alt+Enter on the method giving the Method 'yourFunction()' is never used warning, and selecting

Suppress for methods annotated by 'butterknife.OnClick'