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)