Your First Kotlin Android App - Part 35: Restoring | Ray Wenderlich

When you save the state of your app, you'll want to - at some point - restore it. This video will cover the process.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4738-your-first-kotlin-android-app/lessons/35

Hey man great tutorialโ€ฆ You might need to check if the game has already started when you are rotating / especially the last part of restoreGame:

    if (timeLeftOnTimer != initialCountDown) {
        countDownTimer.start()
        gameStarted = true
    } else {
       // to be verbose, probably not needed, given destroyed & and init with false anyways
        gameStarted = false
    }

Iโ€™ll take a look and see what I find. Thanks!

1 Like