/**
* 获取当前应用程序的版本号
*/
private String getVersion() {
String st = getResources().getString(R.string.Version_number_is_wrong);
PackageManager pm = getPackageManager();
try {
PackageInfo packinfo = pm.getPackageInfo(getPackageName(), 0);
String version = packinfo.versionName;
return version;
} catch (NameNotFoundException e) {
e.printStackTrace();
return st;
}
}
时间: 2024-10-29 07:03:14