通过stage模型可以使用bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT) 具体参考下面链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-refere...其中返回的BundleInfo中的versionCode即是版本号
通过stage模型可以使用bundleManager.getBundleInfoForSelf(bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT)
具体参考下面链接:
https://developer.huawei.com/consumer/cn/doc/harmonyos-refere...
其中返回的BundleInfo中的versionCode即是版本号