Skip to content

Instantly share code, notes, and snippets.

@EliteIntegrity
Created March 5, 2019 12:01
Show Gist options
  • Save EliteIntegrity/90725a7eebcef739ccb224b4b7bdd5c6 to your computer and use it in GitHub Desktop.
Save EliteIntegrity/90725a7eebcef739ccb224b4b7bdd5c6 to your computer and use it in GitHub Desktop.
Loading the high score from the device storage
// To remember the high score
private val prefs: SharedPreferences = context.getSharedPreferences(
"Kotlin Invaders",
Context.MODE_PRIVATE)
private var highScore = prefs.getInt("highScore", 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment