I have been struggling with getting the versionName for a running application from the PackageInfo Object type.
I have constructed a Parcelable Interface with all of the fields associated with the PackageInfo Object type. The primary input for that interface method is a Parcel object.
I cannot seem to figure out how to correctly associate these Parcelable, Parcel, and PackageInfo objects.
Is there any sample code out there that I can look at? Doesn't seem like it should be that difficult but it seems to be stumping me.
Thanks Jazz
Sample code:
try { PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0); return packageInfo.versionName; } catch (NameNotFoundException e) { //Handle exception }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With