如何签入 Android 版本(如 1.5 或 1.6)的代码 [英] How can I check in code the Android version like 1.5 or 1.6
本文介绍了如何签入 Android 版本(如 1.5 或 1.6)的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在代码中检查当前在目标设备上运行的 Android 版本.能否提供代码示例?
I need to check in code what Android release version is running currently on target device. Can you supply code example?
推荐答案
我一直在寻找这个,但没有找到解决方案 - 最终来到这里,我自己想通了,所以对于那些正在寻找这个的人来说:
I was looking for this and didn't find a solution - ended up here and I figured it out myself so for anyone out there looking for this:
int SDK_INT = android.os.Build.VERSION.SDK_INT;
这将返回 os sdk level 7 eclair 8 froyo 等
this returns os sdk level 7 eclair 8 froyo etc
这篇关于如何签入 Android 版本(如 1.5 或 1.6)的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文