diff --git a/android/src/com/unciv/app/AndroidLauncher.kt b/android/src/com/unciv/app/AndroidLauncher.kt index f6cedbdd0e..cf500c92c3 100644 --- a/android/src/com/unciv/app/AndroidLauncher.kt +++ b/android/src/com/unciv/app/AndroidLauncher.kt @@ -64,11 +64,14 @@ class AndroidLauncher : AndroidApplication() { } override fun onResume() { - WorkManager.getInstance(applicationContext).cancelAllWorkByTag(MultiplayerTurnCheckWorker.WORK_TAG) - with(NotificationManagerCompat.from(this)) { - cancel(MultiplayerTurnCheckWorker.NOTIFICATION_ID_INFO) - cancel(MultiplayerTurnCheckWorker.NOTIFICATION_ID_SERVICE) + try { // Sometimes this fails for no apparent reason - the multiplayer checker failing to cancel should not be enough of a reason for the game to crash! + WorkManager.getInstance(applicationContext).cancelAllWorkByTag(MultiplayerTurnCheckWorker.WORK_TAG) + with(NotificationManagerCompat.from(this)) { + cancel(MultiplayerTurnCheckWorker.NOTIFICATION_ID_INFO) + cancel(MultiplayerTurnCheckWorker.NOTIFICATION_ID_SERVICE) + } } + catch (ex:Exception){} super.onResume() } } \ No newline at end of file