Configuring lint checking in Java and XML source files
suggest changeYou can disable Lint checking from your Java and XML source files.
Configuring lint checking in Java
To disable Lint checking specifically for a Java class or method in your Android project, add the @SuppressLint annotation to that Java code.
Example:
@SuppressLint("NewApi")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
To disable checking for every Lint issue:
@SuppressLint("all")
Configuring lint checking in XML
Use the tools:ignore attribute to disable Lint for part of an XML file. Declare xmlns:tools="http://schemas.android.com/tools" on that element or an ancestor.
For example:
tools:ignore="NewApi,StringFormatInvalid"
To suppress every Lint issue on that element:
tools:ignore="all"
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents