/* * 获取版本号 * */ public static String packageCode(Context context){ PackageManager manager = context.getPackageManager(); String code = ""; try { PackageInfo info = manager.getPackageInfo(context.getPackageName(),0); code = info.versionName; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } return code; }
Android 获取应用版本号
最新推荐文章于 2023-08-03 15:59:43 发布