Why doesn't Eclipse understand Build.VERSION_CODES.KITKAT?

I install the SDK for Android 4.4, create a new application (manifest minSdkVersion = 19 and targetSdkVersion = 19), but this code does not work

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {

}

Screenshot

Sorry, I find my mistake. I change the project build target in the project properties to 19.

+4
source share
3 answers

You need to choose Android 4.4 for your project, if you have not already done so. Right click on the project-> Properties-> Android, then check Android 4.4 if it already exists.

+7
source

Change your Build Target project to Android 4.4 (19)

see - How to change the target assembly in an Android project?

+4
source

Android-, :

1-File-> project structure-> Compile Sdk version.

from there select the sdk version to the latest version, so build.version_codes can find Kitkat or higher.

0
source

All Articles