diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java index b00fc12..9b3df36 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java @@ -138,7 +138,7 @@ public class CreateSudokuActivity extends BaseActivity implements IFinalizeDialo if(solvable) { Toast.makeText(CreateSudokuActivity.this, R.string.finished_verifying_custom_sudoku_toast, Toast.LENGTH_LONG).show(); final Intent intent = new Intent(this, GameActivity.class); - intent.setData(Uri.parse("sudoku://" + boardContent)); + intent.setData(Uri.parse(GameActivity.URL_SCHEME_WITHOUT_HOST + "://" + boardContent)); startActivity(intent); finish(); } else { 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 6a504e8..ad301dc 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java @@ -63,6 +63,10 @@ import java.util.List; public class GameActivity extends BaseActivity implements NavigationView.OnNavigationItemSelectedListener, IGameSolvedListener ,ITimerListener, IHintDialogFragmentListener, IResetDialogFragmentListener, IShareDialogFragmentListener { + public static final String URL_SCHEME_WITHOUT_HOST = "sudoku"; + public static final String URL_SCHEME_WITH_HOST = "http"; + public static final String URL_HOST = "sudoku"; + GameController gameController; SudokuFieldLayout layout; SudokuKeyboardLayout keyboard; @@ -124,9 +128,9 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig if (data != null && !intentReceivedFromMainActivity) { String input = ""; - if (data.getScheme().equals("sudoku")){ + if (data.getScheme().equals(URL_SCHEME_WITHOUT_HOST)){ input = data.getHost(); - } else if (data.getScheme().equals("http") && data.getHost().equals("sudoku")){ + } else if (data.getScheme().equals(URL_SCHEME_WITH_HOST) && data.getHost().equals(URL_HOST)){ input = data.getPath(); input =input.replace("/", ""); } @@ -140,7 +144,6 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig try { container.parseGameType("Default_" + sectionSize + "x" + sectionSize); container.parseFixedValues(input); - difficultyCheck = new QQWing(container.getGameType(), GameDifficulty.Unspecified); difficultyCheck.setRecordHistory(true); difficultyCheck.setPuzzle(container.getFixedValues()); @@ -384,8 +387,8 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig break; case R.id.menu_share: - String codeForClipboard = "sudoku://" + gameController.getCodeOfField(); - String codeForClipboard1 = "http://sudoku" + gameController.getCodeOfField(); + String codeForClipboard = URL_SCHEME_WITHOUT_HOST + "://" + gameController.getCodeOfField(); + String codeForClipboard1 = URL_SCHEME_WITH_HOST + "://" + URL_HOST + "/" + gameController.getCodeOfField(); ShareBoardDialog shareDialog = new ShareBoardDialog(); shareDialog.setDisplayCode(codeForClipboard); shareDialog.setCopyClickListener(new View.OnClickListener() {