I follow the code below but it always show 'getPackageInfo() is
undefined' error, anyone knows the reason.
Thanks in advance
On Oct 26, 9:19 pm, Greivin Lopez wrote:
> Or just use the following code snippet:
>
> /**
> * Gets the softwareversionandversionname for this application
> */
> privat
Or just use the following code snippet:
/**
* Gets the software version and version name for this application
*/
private void getSoftwareVersion() {
try {
PackageInfo pi = getPackageManager().getPackageInfo
(getPackageName(), 0);
// Store the software version code
Or just use the following code snippet:
/**
* Gets the software version and version name for this application
*/
private void getSoftwareVersion() {
try {
PackageInfo pi = getPackageManager().getPackageInfo
(getPackageName(), 0);
// Store the software version code
Yeah, look for PackageInfo.versionName and PackageInfo.versionCode.
You can get an instance of PackageInfo from
PackageManager.getPackageInfo(), and you can get THAT from your
Activity through getPackageManager().
On Oct 25, 6:14 am, matteoli wrote:
> I would like to show the current version of
4 matches
Mail list logo