标签:
private String getVersion(){ //得到包管理器 PackageManager packageManager = getPackageManager(); PackageInfo packageInfo = null; try { //传入包名 packageInfo = packageManager.getPackageInfo(getPackageName(),0); } catch (NameNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } return packageInfo.versionName; }
标签:
原文地址:http://www.cnblogs.com/84126858jmz/p/4998230.html