mirror of
https://github.com/GrakovNe/lissen-android.git
synced 2026-06-18 21:58:39 -04:00
Fix rare App crash on Shortcut run
This commit is contained in:
@@ -32,14 +32,10 @@ class AppActivity : ComponentActivity() {
|
||||
|
||||
private lateinit var appNavigationService: AppNavigationService
|
||||
|
||||
private var launchAction: AppLaunchAction = AppLaunchAction.DEFAULT
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
|
||||
handleIntent(intent)
|
||||
|
||||
setContent {
|
||||
val colorScheme by preferences
|
||||
.colorSchemeFlow
|
||||
@@ -55,21 +51,14 @@ class AppActivity : ComponentActivity() {
|
||||
preferences = preferences,
|
||||
imageLoader = imageLoader,
|
||||
networkQualityService = networkQualityService,
|
||||
appLaunchAction = launchAction,
|
||||
appLaunchAction = getLaunchAction(intent),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
handleIntent(intent)
|
||||
}
|
||||
|
||||
private fun handleIntent(intent: Intent?) {
|
||||
launchAction = when (intent?.action) {
|
||||
"continue_playback" -> AppLaunchAction.CONTINUE_PLAYBACK
|
||||
else -> AppLaunchAction.DEFAULT
|
||||
}
|
||||
private fun getLaunchAction(intent: Intent?) = when (intent?.action) {
|
||||
"continue_playback" -> AppLaunchAction.CONTINUE_PLAYBACK
|
||||
else -> AppLaunchAction.DEFAULT
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
android.useAndroidX=true
|
||||
kotlin.code.style=official
|
||||
android.nonTransitiveRClass=true
|
||||
VERSION_NAME=1.4.1
|
||||
VERSION_NAME=1.4.2
|
||||
|
||||
Reference in New Issue
Block a user