📜  android 获取 sdk 版本 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:07.503000             🧑  作者: Mango

代码示例1
if(android.os.Build.VERSION.SDK_INT ==  android.os.Build.VERSION_CODES.LOLLIPOP){
    // Code For Android Version higher equal to LOLLIPOP(21)
} else if(android.os.Build.VERSION.SDK_INT > 21){
    // Code For Android Version higher than LOLLIPOP(21)
} else{
    // Code For Android Version lower than LOLLIPOP(21)
}