Fix version
This commit is contained in:
parent
80c8d0a739
commit
df2b14e5b9
1 changed files with 9 additions and 8 deletions
|
@ -50,15 +50,16 @@ public class Version {
|
||||||
|
|
||||||
private Version(OsmandApplication ctx) {
|
private Version(OsmandApplication ctx) {
|
||||||
// appVersion = ctx.getString(R.string.app_version);
|
// appVersion = ctx.getString(R.string.app_version);
|
||||||
appVersion = "";
|
String appVersion = "";
|
||||||
int versionCode = -1;
|
int versionCode = -1;
|
||||||
try {
|
try {
|
||||||
PackageInfo packageInfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
|
PackageInfo packageInfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
|
||||||
appVersion = packageInfo.versionName;
|
appVersion = packageInfo.versionName;
|
||||||
versionCode = packageInfo.versionCode;
|
versionCode = packageInfo.versionCode;
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
this.appVersion = appVersion;
|
||||||
appName = ctx.getString(R.string.app_name);
|
appName = ctx.getString(R.string.app_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue