英文:
Verify android version kotlin Android 33
问题
Resolução do problema foi
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
verdadeiro
} else {
falso
}
英文:
I had a problem recently and I couldn't get an easy answer on the internet, I come to share my experience.
I needed to check the android version via code with all the ways I found on the internet were deprecated, here's the way I found current for this simple check
Resolução do problema foi
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P){
true
}
else{
false
}
答案1
得分: 1
你可以使用以下函数检查你的 Android 版本是否为 33:
fun isAndroid33(): Boolean {
return Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU
}
英文:
You can check if your android version 33 or not by using this function:
fun isAndroid33(): Boolean {
return Build.VERSION.SDK_INT == Build.VERSION_CODES.TIRAMISU
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论