💩 Start on persistence

main
Alexis Drai 3 years ago
parent 5d93535849
commit 0ab3598f5f

@ -20,7 +20,6 @@ class QuizActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_quiz)
val questions = Stub().loadQuestions(resources)
val textViewQuestion = findViewById<TextView>(R.id.textViewQuestion)
@ -63,6 +62,17 @@ class QuizActivity : AppCompatActivity() {
super.onDestroy()
}
override fun onSaveInstanceState(outState: Bundle) {
// Save the user's current game state
outState.run {
// putInt(myVar, savedVar)
}
// Always call the superclass so it can save the view hierarchy state
super.onSaveInstanceState(outState)
}
private fun assignAnswerToButton(btn: Button, toast: String) {
btn.setOnClickListener {
Toast.makeText(this, toast, Toast.LENGTH_SHORT).show()

Loading…
Cancel
Save