diff --git a/app/build.gradle b/app/build.gradle index 297c786..475f8c5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,7 +8,7 @@ android { minSdkVersion 19 targetSdkVersion 29 versionCode 1 - versionName "2.0" + versionName "2.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/release/app-release.apk b/app/release/app-release.apk index e2812e6..2828f3b 100644 Binary files a/app/release/app-release.apk and b/app/release/app-release.apk differ diff --git a/app/release/output.json b/app/release/output.json index ad72600..50f0177 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/eclipse7/polytuner/MainActivity.java b/app/src/main/java/com/eclipse7/polytuner/MainActivity.java index 5879cb7..d966753 100644 --- a/app/src/main/java/com/eclipse7/polytuner/MainActivity.java +++ b/app/src/main/java/com/eclipse7/polytuner/MainActivity.java @@ -4,6 +4,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; +import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.res.Resources; import android.os.Bundle; @@ -152,10 +153,18 @@ public boolean onOptionsItemSelected(MenuItem item) { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); alertDialogBuilder.setCancelable(true); + String version = ""; + try { + PackageInfo pInfo = this.getPackageManager().getPackageInfo(getPackageName(), 0); + version = pInfo.versionName; + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + View view = getLayoutInflater().inflate(R.layout.about_dialog, null); - TextView version = view.findViewById(R.id.about); - String s = "Tuner version " + "1.0"; - version.setText(s); + TextView version_view = view.findViewById(R.id.about); + String s = "Tuner version " + version; + version_view.setText(s); alertDialogBuilder.setView(view); alertDialogBuilder.setTitle(R.string.info_title);