Fixes #3729 "Android crash on loading from custom location" (#3828)

This commit is contained in:
SomeTroglodyte 2021-04-21 22:42:45 +02:00 committed by GitHub
parent 2b6c9e7ec0
commit 600f262cca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,7 +96,9 @@ class LoadGameScreen(previousScreen:CameraStageBaseScreen) : PickerScreen() {
loadFromCustomLocation.onClick {
GameSaver.loadGameFromCustomLocation { gameInfo, exception ->
if (gameInfo != null) {
game.loadGame(gameInfo)
Gdx.app.postRunnable {
game.loadGame(gameInfo)
}
} else if (exception !is CancellationException) {
errorLabel.setText("Could not load game from custom location!".tr())
exception?.printStackTrace()
@ -195,4 +197,4 @@ class LoadGameScreen(previousScreen:CameraStageBaseScreen) : PickerScreen() {
}
}
}
}