From 74f4bf1c0d29e7c26b55e3f46b61611dfd46c37b Mon Sep 17 00:00:00 2001 From: Christopher Beckmann Date: Sat, 20 Feb 2016 23:11:25 +0100 Subject: [PATCH] Fixed another crash occuring when changing the screen orientation when a dialog is opened. --- .../org/secuso/privacyfriendlysudoku/ui/GameActivity.java | 6 +++--- .../ui/view/SudokuSpecialButtonLayout.java | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) 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 00478b2..a840875 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/GameActivity.java @@ -240,8 +240,8 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On switch(id) { case R.id.menu_reset: - ResetConfirmationDialog hintDialog = new ResetConfirmationDialog(); - hintDialog.show(getFragmentManager(), "ResetDialogFragment"); + ResetConfirmationDialog resetDialog = new ResetConfirmationDialog(); + resetDialog.show(getFragmentManager(), "ResetDialogFragment"); break; case R.id.nav_newgame: @@ -391,7 +391,7 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On public void onAttach(Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface - if(activity instanceof IHintDialogFragmentListener) { + if(activity instanceof IResetDialogFragmentListener) { listeners.add((IResetDialogFragmentListener) activity); } } diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuSpecialButtonLayout.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuSpecialButtonLayout.java index 6f6860b..4bf1ba5 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuSpecialButtonLayout.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/view/SudokuSpecialButtonLayout.java @@ -1,6 +1,5 @@ package org.secuso.privacyfriendlysudoku.ui.view; -import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; @@ -180,8 +179,7 @@ public class SudokuSpecialButtonLayout extends LinearLayout implements IHighligh } } - @SuppressLint("ValidFragment") - public class HintConfirmationDialog extends DialogFragment { + public static class HintConfirmationDialog extends DialogFragment { LinkedList listeners = new LinkedList<>();