标签:
1 private String getVersionsName(){ 2 PackageManager packageManager = getPackageManager(); 3 try { 4 //获取包的信息 5 //Manager 管理 6 PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(),0); 7 //获取版本号 8 String versions = packageInfo.versionName; 9 Log.e("test",versions); 10 return versions; 11 } catch (PackageManager.NameNotFoundException e) { 12 //为获取到包名 13 e.printStackTrace(); 14 } 15 16 return null; 17 }
标签:
原文地址:http://www.cnblogs.com/sdwfqin/p/5236430.html