From 2f95f1ebb2ab1fff254223b19bd06329a674f659 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 25 Aug 2020 19:39:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/App.kt | 5 ++--- app/src/main/java/io/legado/app/ui/main/MainActivity.kt | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/App.kt b/app/src/main/java/io/legado/app/App.kt index e893bc64b..a96db68fb 100644 --- a/app/src/main/java/io/legado/app/App.kt +++ b/app/src/main/java/io/legado/app/App.kt @@ -37,11 +37,10 @@ class App : MultiDexApplication() { private set lateinit var androidId: String + var versionCode = 0 + var versionName = "" } - var versionCode = 0 - var versionName = "" - override fun onCreate() { super.onCreate() INSTANCE = this diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 0c02d5abd..1de002931 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -93,8 +93,8 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), } private fun upVersion() { - if (getPrefInt(PreferKey.versionCode) != App.INSTANCE.versionCode) { - putPrefInt(PreferKey.versionCode, App.INSTANCE.versionCode) + if (getPrefInt(PreferKey.versionCode) != App.versionCode) { + putPrefInt(PreferKey.versionCode, App.versionCode) if (!BuildConfig.DEBUG) { val log = String(assets.open("updateLog.md").readBytes()) TextDialog.show(supportFragmentManager, log, TextDialog.MD, 5000, true)