public String getVersionName() { String versionName = ""; PackageManager packageManager = getPackageManager(); try { PackageInfo packageInfo = packageManager.getPackageInfo("com.example.picdemo", 0); versionName=packageInfo.versionName; } catch (NameNotFoundException e) { e.printStackTrace(); } return versionName; }
时间: 2024-10-25 13:00:35