diff --git a/OsmAnd/src/net/osmand/plus/Version.java b/OsmAnd/src/net/osmand/plus/Version.java index fbbdf4bb1d..1dba5a4f8e 100644 --- a/OsmAnd/src/net/osmand/plus/Version.java +++ b/OsmAnd/src/net/osmand/plus/Version.java @@ -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); }