Android Studio: how to stop getting error labels on unused characters

In any code, I think there are variables / methods / classes that are not really used and maybe just for showing / just in case.

In any case, how to install Android Studio to stop giving me the "yellow" error bar labels in the scroll bar for unused variables. Although, I do not want to stop receiving warnings together.

+7
android intellij-idea android-studio ide
source share
3 answers

Launch it!

Right-click the scroll bar> Customize Highlight Level > Configure inspections . You will find a huge list, enter the search field for unused , after which you will see "Unused Symbol", not checked.

+12
source share

add SuppressWarnings annotation to methods / variables / classes that are not used ...

 @SuppressWarnings("unused") private String unusedString; @SuppressWarnings("unused") private void unusedMethod() { } @SuppressWarnings("unused") private class UnUsedClass { } 
+5
source share

Highlight Level android studio

You can change the selection level by clicking the button in the right corner in the Android studio.

+5
source share

All Articles