Stefan4472 / GalaxyRun

A space-themed infinite runner for Android
GNU General Public License v3.0
0 stars 0 forks source link

GameActivity::onCreate() called after screen lock #165

Open Stefan4472 opened 1 year ago

Stefan4472 commented 1 year ago

When the screen is locked, the GameActivity is paused and destroyed, then it is recreated, started, paused, and destroyed again. This causes the music to stop, then start briefly for a second before stopping again.

We need to handle this case to avoid re-initializing the game when it happens.

See: https://stackoverflow.com/questions/16320040/android-oncreate-is-called-after-locking-the-screen