Supported @SuppressWarnings Values in Android Stud

2019-02-03 22:13发布

问题:

What are all of the supported values for @SuppressWarnings in Android Studio?

I couldn't find any documentation on it, and I know it isn't the same as Eclipse because "null" doesn't work. You can catch null warnings with "all", but as you can imagine I'd rather not.

回答1:

These are not intended to be entered by hand, use Alt+Enter, Suppress... menu item (from the right arrow sub-menu) on the code that is highlighted with the inspection.



回答2:

Look at this page for list of @SuppressWwarnings :

https://gist.github.com/elevenetc/bf795f94aaf3e92169ef



回答3:

This is very simple, just click on the deprecated word and press ALT + ENTER on your keyboard, click on --> Inspection 'Deprecated API usage' options. In the drop-down menu, u can select the option that matches your choice, e.g Suppress for class, Suppress for method, Suppress for statement.. Hope it helps.