diff --git a/app/build.gradle b/app/build.gradle index df1eba7c95..ab4baddf93 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,9 +8,9 @@ android { defaultConfig { applicationId "org.ole.planet.myplanet" minSdkVersion 21 - targetSdkVersion 34 - versionCode 1616 - versionName "0.16.16" + targetSdkVersion 34 + versionCode 1617 + versionName "0.16.17" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt b/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt index 842e7f5013..837e4da13f 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt @@ -3,6 +3,7 @@ package org.ole.planet.myplanet.ui.sync import android.content.* import android.graphics.drawable.AnimationDrawable import android.os.* +import android.os.Build.VERSION_CODES.TIRAMISU import android.text.* import android.view.* import android.view.inputmethod.EditorInfo @@ -60,10 +61,15 @@ class LoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener { if (forceSync) { isSync = false } - if (intent.hasExtra("versionInfo")) { - onUpdateAvailable((intent.getSerializableExtra("versionInfo") as MyPlanet?), - intent.getBooleanExtra("cancelable", false) - ) + val versionInfo = if (Build.VERSION.SDK_INT >= TIRAMISU) { + intent.getSerializableExtra("versionInfo", MyPlanet::class.java) + } else { + @Suppress("DEPRECATION") + intent.getSerializableExtra("versionInfo") as? MyPlanet + } + + if (versionInfo != null) { + onUpdateAvailable(versionInfo, intent.getBooleanExtra("cancelable", false)) } else { service.checkVersion(this, settings) }