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

后端 未结 4 1931
Happy的楠姐
Happy的楠姐 2020-12-30 18:35

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\"

4条回答
  •  难免孤独
    2020-12-30 19:25

    Osvald's answer is spot on.

    However, if you want to avoid suppressing warnings separately for each type of butterknife annotation, follow his instructions, and then open up .idea/misc.xml and find this section:

    
      
      
        
      
    
    

    Therein, simply replace butterknife.OnClick with butterknife.*.

    From now on, all your injected event handlers will evade the warning.

提交回复
热议问题