Reputation: 10441
For some lint checks I can suppress them with a comment or a method annotation. ConstantConditions
is a good example:
However for other checks I can only suppress via a method annotation. CheckResult
is an example.
Is there any reason for this difference? Is it just that Android tools team hasn't added a comment-based suppression check?
Upvotes: 1
Views: 395
Reputation: 846
Basically, Android Studio comes with a two sets of inspections:
So, ConstantConditions
is an Intellij IDEA inspection, and CheckResult
is coming from Android Lint.
I think the reason that Android Lint checks usually disabled with @SuppressLint
annotation is just that it's technically easier to understand that check is suppressed or not for a particular source code element.
Actually, you can suppress a check will comment like this:
//noinspection CheckResult
But it only works when running lint from the command line, but not in Android Studio.
Upvotes: 1