MakerModder
MakerModder

Reputation: 1571

Set android studio warning levels

I'm trying to work with android studio, and so far so good. However, it has yellow indexes, warnings, lightbulbs, (etc) all over the place!

Which is a problem. No, my code isn't actually filled with real warnings, it's mostly style nitpicking items such as "Simplify" FLAG_AUTOSAVE == false to !FLAG_AUTOSAVE

Which, no I don't want to do, that isn't my style, I like my code to be more clear at a glance.

Or actually incorrect advice like change the signature of an correctly overridden method. (well it is still version 1.x...)

Regardless if my style is perfect or not, I need these to go away So I can see the real warnings.

Upvotes: 21

Views: 17306

Answers (3)

SMBiggs
SMBiggs

Reputation: 11688

The latest version of Android Studio (2.1) seems to have a lot more flexibility with its warnings. Settings -> Editor -> Inspections has increased greatly. Then use the search feature to help find the warnings/errors you want to dis(en)able. Then click the checkboxes for the settings you like.

Don't forget to choose "Default" or "Project Default" in the drop-down box.

In this image I managed to find your specific issue (I completely agree with you about that one!) which I unchecked.

enter image description here

Upvotes: 14

Paul
Paul

Reputation: 158

You can see your warning scheme by going to Android Studio -> Preferences. On the left side of the window you'll see many options organised in two groups: Project Settings [your project name] and IDE Settings. Inside the former look for Inspections. Now you can decide everything lint will have to say about your code.

AS version 1.1.0.

Upvotes: 3

Booger
Booger

Reputation: 18725

These warnings you are seeing are related to the 'Lint' Static Analysis tool.

Not sure about Android Studio, but you can usually right-click to eliminate a particular warning from being shown, or you can actually go into the Lint preferences and disable certain (or all) warnings from a central console.

I find those warnings generally very helpful, and encourage you to not dismiss them so quickly.

Upvotes: 3

Related Questions