Hopefully mitigated some very odd multiplayer-checker-related crashes
This commit is contained in:
parent
1bb26c579d
commit
18b2c5868b
1 changed files with 7 additions and 4 deletions
|
@ -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()
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue