PackageInfo pf = null;
pf = getConfiguration(pf);
Log.i("PackageInfo", pf.versionCode + pf.packageName + pf.versionName);
/**
* 获取本应用的配置信息
*
* @param pf
* @return
*/
public PackageInfo getConfiguration(PackageInfo pf) {
try {
pf = getPackageManager().getPackageInfo(this.getPackageName(), 0);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
return pf;
}
转载于:https://blog.51cto.com/lovely1133/567839