在 Android Studio 中关闭烦人的检查 [英] Turn off an annoying Inspection, in Android Studio
问题描述
我正在使用 Android Lollypop 的 JobScheduler
.Android Studio 正在标记此代码:
I'm working with Android Lollypop's JobScheduler
. Android Studio is flagging this code:
JobScheduler js = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);
...作为一个错误.它编译得很好.但是,Studio 认为它了解所有法律服务,并对其进行了标记.
... as an error. It compiles fine. Studio, though, thinks it knows all of the legal services, and marks it.
我猜这是一次检查".我在检查中搜索了以必须是其中之一:Context.POWER_SERVICE"开头的错误消息,但没有找到任何内容.
I'm guessing that this is an "Inspection". I searched inspections for the error message, which begins "Must be one of: Context.POWER_SERVICE" and didn't find anything.
这让我想到了一个具体的问题:我怎样才能关闭这个特别烦人的错误".此外,更普遍的问题是:一般来说,如果检查让我很烦恼,我该如何找到它,以便我可以将其关闭?"
This leads me to the specific question: "how can I turn off this, particular, annoying error". Also, the more general question: "In general, if an inspection is annoying me, how do I find it, so that I can turn it off?"
推荐答案
在基于 IntelliJ 的 IDE 中禁用不需要的检查的一般方法:
General way to disable inspections you don't want in IntelliJ based IDEs:
- 导航到代码中显示由检查引起的警告的部分
- 按Alt + 回车
- 从该菜单中,您可以导航至编辑检查配置文件设置
- 您可以在那里更改检查级别(错误/警告/信息/...)或完全禁用它
或者,您可以在设置/检查中找到所有检查的列表.
Alternatively you can find list of all inspections in Settings/Inspections.
这篇关于在 Android Studio 中关闭烦人的检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!