Mark Suppress Warnings

suggest change

It is good practice to mark some warnings in your code. For example, a deprecated method may be needed for a test or for an old support library, and Lint will mark that code. To hide one warning category, use @SuppressWarnings. The javac name for this category is deprecation, not deprecated.

To ignore deprecation warnings, put that name in the annotation:

@SuppressWarnings("deprecation")
public void setAnotherColor (int newColor) {
    getApplicationContext().getResources().getColor(newColor);
}

The annotation hides the named warning category. It does not hide every Lint or compiler warning.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents