Reputation: 1214
I install SDK for Android 4.4, create new app (manifest minSdkVersion=19 and targetSdkVersion=19), but this code don't work
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
}
I'm sorry, I find my mistake. I change Project Build Target in Project's Properties to 19.
Upvotes: 4
Views: 6188
Reputation: 286
If you are using android studio do the following:
1-File->project structure->Compile Sdk Version.
from there select the sdk version to latest so build.version_codes can find Kitkat or above.
Upvotes: 0
Reputation: 1570
Change you project's Build Target to Android 4.4 (19)
see - How to change target build on Android project?
Upvotes: 4
Reputation: 1129
You have to select Android 4.4 for your project if you haven't done so. Right click on top of the project->Properties->Android then check Android 4.4 if that is already there.
Upvotes: 7