Fix for #6178 music resumes after minimizing on android (#6195)

This commit is contained in:
SomeTroglodyte 2022-02-19 17:40:52 +01:00 committed by GitHub
parent 2d60fe4565
commit 6e92ea4d29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,11 +157,13 @@ class UncivGame(parameters: UncivGameParameters) : Game() {
// This is ALWAYS called after create() on Android - google "Android life cycle"
override fun resume() {
super.resume()
musicController.resume()
if (!isInitialized) return // The stuff from Create() is still happening, so the main screen will load eventually
}
override fun pause() {
if (isGameInfoInitialized()) GameSaver.autoSave(this.gameInfo)
musicController.pause()
super.pause()
}