Issue
Android Studio 4.1 suggests avoiding using android.media.exifinterface
and using android.support.media.exifinterface
instead. We may want to suppress it, e.g., if the project has min SDK API 24, and it is known that android.media.exifinterface
is fine for API 24 and above.
Android Studio's context menu gives Add @SuppressLint("ExifInterface")
but nothing happens on clicking that. Adding @SuppressLint("ExifInterface")
in several places (trying one at a time, of course) doesn't work, e.g.,
- the line immediately above the
import android.media.exifinterface;
statement - the line before the
package
line at the top of the whole file
Where is the right place to add this @SuppressLint annotation?
Solution
Like you, I cannot find a place for the @SuppressLint
that works to suppress a Lint warning on an import
statement. 😕
In this case, my guess is that you would want to be suppressing this module-wide anyway. I cannot think of a scenario where you would want to use the framework ExifInterface
in some places and the library ExifInterface
in others. So, you could use stuff like lint.xml
or lintOptions
in the module's build.gradle
file to suppress it for the entire module.
Answered By - CommonsWare
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.