删除“从不使用方法"Android Studio 中 OnClick 注释的警告 [英] Remove "Method is never used" warning for OnClick annotation in Android Studio

查看:23
本文介绍了删除“从不使用方法"Android Studio 中 OnClick 注释的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

抱歉,如果之前有人问过这个问题.我正在将 Butterknife 5.0 与最新版本的 Android Studio (0.5.7) 一起使用.对于使用 ButterKnife 的OnClick"注释的方法,如何删除从不使用方法"警告.我注意到 Eclipse 没有为OnClick"方法提供此警告.提前致谢

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

推荐答案

Android Studio 中抑制这些警告的正确方法是在给出 Method ' 的方法上按 Alt+EnteryourFunction()' 从未使用警告,并选择

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'

这篇关于删除“从不使用方法"Android Studio 中 OnClick 注释的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆