Fix version

This commit is contained in:
Victor Shcherb 2017-05-18 20:22:46 +02:00
parent 80c8d0a739
commit df2b14e5b9

View file

@ -50,15 +50,16 @@ public class Version {
private Version(OsmandApplication ctx) {
// appVersion = ctx.getString(R.string.app_version);
appVersion = "";
int versionCode = -1;
String appVersion = "";
int versionCode = -1;
try {
PackageInfo packageInfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
appVersion = packageInfo.versionName;
versionCode = packageInfo.versionCode;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
PackageInfo packageInfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
appVersion = packageInfo.versionName;
versionCode = packageInfo.versionCode;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
this.appVersion = appVersion;
appName = ctx.getString(R.string.app_name);
}