/**
* Retrieves application's version number from the manifest
*
* @return
*/
public String getVersion(){
String version = "0.0.0";
PackageManager packageManager = getPackageManager();
try {
PackageInfo packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
version = packageInfo.versionName;
} catch (NameNotFoundException e) {
e.printStackTrace();
}
return version;
}
Android 应用程序获得版本号
最新推荐文章于 2024-08-23 14:59:10 发布