diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b69f4f1..476543e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -42,6 +42,7 @@ diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/helper/GameInfoContainer.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/helper/GameInfoContainer.java index 43ed14e..9365a39 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/helper/GameInfoContainer.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/helper/GameInfoContainer.java @@ -104,6 +104,11 @@ public class GameInfoContainer { fixedValues = new int[s.length()]; for(int i = 0; i < s.length(); i++) { fixedValues[i] = Symbol.getValue(Symbol.SaveFormat, String.valueOf(s.charAt(i)))+1; + if (gameType != GameType.Unspecified && gameType != null) { + if (fixedValues[i] < 0 || fixedValues[i] > gameType.getSize()) { + throw new IllegalArgumentException("Fixed values must each be smaller than " + gameType.getSize() + "."); + } + } } } diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java index 8bf32de..80b9bf4 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java @@ -130,8 +130,8 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig GameType.Unspecified, new int [boardSize], new int [boardSize], new boolean [boardSize][sectionSize]); try { - container.parseFixedValues(input); container.parseGameType("Default_" + sectionSize + "x" + sectionSize); + container.parseFixedValues(input); difficultyCheck = new QQWing(container.getGameType(), GameDifficulty.Unspecified); difficultyCheck.setRecordHistory(true); @@ -303,6 +303,14 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig } gameController.deleteTimer(); } + + @Override + public void onNewIntent(Intent intent) { + super.onNewIntent(intent); + startActivity(intent); + finish(); + } + @Override public void onResume(){ super.onResume();