Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: How to stop getting error marks on unused symbols

In any code, i guess, there are variables/method/classes that are really not used and maybe just there for show/just in case.

Anyway, How do i set Android Studio to stop giving me the 'yellow' error stripe marks in the scrollbar for unused variables. Although, i don't want to stop getting warnings all together.

like image 584
A. K. Tolentino Avatar asked Jan 23 '14 06:01

A. K. Tolentino


2 Answers

Fount it!

Right click the scroll bar > Customize Highlight Level > Configure inspections. You'll find an immense list, type-in the search field for unused then you'll see "Unused Symbol", unchecked it.

like image 198
A. K. Tolentino Avatar answered Sep 28 '22 04:09

A. K. Tolentino


add SuppressWarnings annotation at the methods/variables/classes which are unused...

@SuppressWarnings("unused")
private String unusedString;

@SuppressWarnings("unused")
private void unusedMethod() {

}

@SuppressWarnings("unused")
private class UnUsedClass {

}
like image 43
Gopal Gopi Avatar answered Sep 28 '22 03:09

Gopal Gopi