21

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.

3 Answers 3

14

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

Sign up to request clarification or add additional context in comments.

3 Comments

Yes when I wrote the question 2 years ago there was no fix really. But this question still gets activity so I will update you to the correct answer.
No longer seems to work now that I've updated Android Studio to 2.1.3. Anyone else have this problem? Any why doesn't the warning point to the inspection that causes it? Yeah yeah, I know: because that would make sense. Sigh.
2.1.3 is old. Why not try 2.2rc. That said this question is several years old, but it should still work.
3

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.

1 Comment

Lint is something not to ignore. Though looking at lint is usually done later.. That being said there are too many, and too many incorrect warnings to be lint, me thinks.
3

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.

1 Comment

Yeah except some of the Android-specific stuff is bundled up into two items, "Error from Custom Lint Check" and "Warning from Custom Lint Check". No idea how to configure those. I've looked through the whole list of Android warnings and haven't found some of the ones in my editor, such as "Avoid passing null as the view root".

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.