📌  相关文章
📜  android 以编程方式获取应用程序版本 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:50.382000             🧑  作者: Mango

代码示例3
PackageManager manager = this.getPackageManager();
PackageInfo info = manager.getPackageInfo(this.getPackageName(), PackageManager.GET_ACTIVITIES);
Toast.makeText(this,
     "PackageName = " + info.packageName + "\nVersionCode = "
       + info.versionCode + "\nVersionName = "
       + info.versionName + "\nPermissions = " + info.permissions, Toast.LENGTH_SHORT).show();