标签:
private static int testPackageInfo(Context context){
int localVersionCode = 9999;
try
{
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(),0);
String localVersionName =packageInfo.versionName;
System.out.print(localVersionName);
localVersionCode = packageInfo.versionCode;
System.out.print(localVersionCode);
}catch (Exception e)
{}
return localVersionCode;
}
标签:
原文地址:http://www.cnblogs.com/Twain-Wang/p/5613272.html