Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't deprecation warning disappear when verifying Build.VERSION.SDK_INT before using deprecated item?

THEME_HOLO_LIGHT was deprecated in API 23.

So why do I still get a deprecation warning when verifying I'm using it on API < 23?

enter image description here

Relevant piece of my build.gradle:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    useLibrary "org.apache.http.legacy"
    defaultConfig {
        applicationId "com.my.app"
        minSdkVersion 14
        targetSdkVersion 23
}
like image 694
Adam Johns Avatar asked Mar 09 '16 01:03

Adam Johns


1 Answers

I also experienced the same issue when using targetSdkVersion containing deprecated code. It seems that the if statement is ignored by Lint check. So, I have to suppress lint on that block to remove the warning.

like image 188
T D Nguyen Avatar answered Oct 13 '22 11:10

T D Nguyen