diff --git a/.gradle/7.5/executionHistory/executionHistory.bin b/.gradle/7.5/executionHistory/executionHistory.bin index 91c2c35..660bae8 100644 Binary files a/.gradle/7.5/executionHistory/executionHistory.bin and b/.gradle/7.5/executionHistory/executionHistory.bin differ diff --git a/.gradle/7.5/executionHistory/executionHistory.lock b/.gradle/7.5/executionHistory/executionHistory.lock index 3788544..abb3ff0 100644 Binary files a/.gradle/7.5/executionHistory/executionHistory.lock and b/.gradle/7.5/executionHistory/executionHistory.lock differ diff --git a/.gradle/7.5/fileHashes/fileHashes.bin b/.gradle/7.5/fileHashes/fileHashes.bin index e26e9f7..9fd8be4 100644 Binary files a/.gradle/7.5/fileHashes/fileHashes.bin and b/.gradle/7.5/fileHashes/fileHashes.bin differ diff --git a/.gradle/7.5/fileHashes/fileHashes.lock b/.gradle/7.5/fileHashes/fileHashes.lock index a05e4a7..63f40ac 100644 Binary files a/.gradle/7.5/fileHashes/fileHashes.lock and b/.gradle/7.5/fileHashes/fileHashes.lock differ diff --git a/.gradle/7.5/fileHashes/resourceHashesCache.bin b/.gradle/7.5/fileHashes/resourceHashesCache.bin index a337bea..8ecabf2 100644 Binary files a/.gradle/7.5/fileHashes/resourceHashesCache.bin and b/.gradle/7.5/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 4093a27..7499d73 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/app/src/main/java/com/example/mastermind/ChoixDuMotDePasse.java b/app/src/main/java/com/example/mastermind/ChoixDuMotDePasse.java index 8e9f1b6..17a0b0d 100644 --- a/app/src/main/java/com/example/mastermind/ChoixDuMotDePasse.java +++ b/app/src/main/java/com/example/mastermind/ChoixDuMotDePasse.java @@ -1,9 +1,11 @@ package com.example.mastermind; +import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; +import android.util.Log; import android.view.View; import com.example.mastermind.controller.ChoixDuMotDePasse.OnTouchBoutonValider; @@ -57,4 +59,27 @@ public class ChoixDuMotDePasse extends AppCompatActivity { this.startActivity(mastermind); this.finish(); } + + @Override + protected void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + if (outState == null){ + outState = new Bundle(); + } + outState.putIntArray("code", new int[]{this.un.getColor(), this.deux.getColor(), this.trois.getColor(), this.quatre.getColor()}); + } + + @Override + protected void onRestoreInstanceState(Bundle savedInstanceState) { + super.onRestoreInstanceState(savedInstanceState); + if (savedInstanceState != null){ + if (savedInstanceState.containsKey("code")){ + int[] code = savedInstanceState.getIntArray("code"); + this.un.setColor(code[0]); + this.deux.setColor(code[1]); + this.trois.setColor(code[2]); + this.quatre.setColor(code[3]); + } + } + } } \ No newline at end of file