This tutorial is to get the application version no. For this purpose we will be using PackageInfo.
try
{
pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
strVersion = pInfo.versionName;
PackageInfo pInfo = null;
String strVersion;
try
{
pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
strVersion = pInfo.versionName;
No comments:
Post a Comment