话不多说,直接贴代码
PackageManager manager; PackageInfo info = null; manager = this.getPackageManager(); try { info = manager.getPackageInfo(this.getPackageName(), 0); String name = info.versionName; int versionCode = info.versionCode; String packageName = info.packageName; Signature[] signatures = info.signatures; System.out.println(name+"++++++++++"+versionCode+"+++++"+packageName+"========nnn"+signatures+"=============");
以上的代码就能获取其版本号