I’m trying to display versionName using below code
PackageManager pkm = getPackageManager();
PackageInfo pki = pkm.getPackageInfo("com.example", PackageManager.GET_CONFIGURATIONS);
String tempCurrentVersion = pki.versionName;
But I’m getting exception at PackageManager.GET_CONFIGURATIONS as NameNotFoundException
Please tell me how i can solve this issue.
Thanks
I use this is my app and it works correctly.
If that doesn’t work make sure your package name is correct. There
aren’t any special permissions for this.