Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 632
StarWind0 Avatar asked Sep 05 '13 17:09

StarWind0


2 Answers

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

like image 192
SMBiggs Avatar answered Oct 13 '22 22:10

SMBiggs


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.

like image 40
Booger Avatar answered Oct 13 '22 23:10

Booger