Android判断SDK版本及判断是否联网
发布时间:2015-06-05 来源:查字典编辑
摘要:publicstaticintgetSDKVersionNumber(){intsdkVersion;try{sdkVersion=Inte...
public static int getSDKVersionNumber() {
int sdkVersion; try { sdkVersion = Integer.valueOf(android.os.Build.VERSION.SDK); } catch (NumberFormatException e) { sdkVersion = 0; } return sdkVersion; }