Fixed another crash occuring when changing the screen orientation when a dialog is opened.

This commit is contained in:
Christopher Beckmann 2016-02-20 23:11:25 +01:00
parent ee3784ca39
commit 74f4bf1c0d
2 changed files with 4 additions and 6 deletions

View file

@ -240,8 +240,8 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
switch(id) { switch(id) {
case R.id.menu_reset: case R.id.menu_reset:
ResetConfirmationDialog hintDialog = new ResetConfirmationDialog(); ResetConfirmationDialog resetDialog = new ResetConfirmationDialog();
hintDialog.show(getFragmentManager(), "ResetDialogFragment"); resetDialog.show(getFragmentManager(), "ResetDialogFragment");
break; break;
case R.id.nav_newgame: case R.id.nav_newgame:
@ -391,7 +391,7 @@ public class GameActivity extends AppCompatActivity implements NavigationView.On
public void onAttach(Activity activity) { public void onAttach(Activity activity) {
super.onAttach(activity); super.onAttach(activity);
// Verify that the host activity implements the callback interface // Verify that the host activity implements the callback interface
if(activity instanceof IHintDialogFragmentListener) { if(activity instanceof IResetDialogFragmentListener) {
listeners.add((IResetDialogFragmentListener) activity); listeners.add((IResetDialogFragmentListener) activity);
} }
} }

View file

@ -1,6 +1,5 @@
package org.secuso.privacyfriendlysudoku.ui.view; package org.secuso.privacyfriendlysudoku.ui.view;
import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
@ -180,8 +179,7 @@ public class SudokuSpecialButtonLayout extends LinearLayout implements IHighligh
} }
} }
@SuppressLint("ValidFragment") public static class HintConfirmationDialog extends DialogFragment {
public class HintConfirmationDialog extends DialogFragment {
LinkedList<IHintDialogFragmentListener> listeners = new LinkedList<>(); LinkedList<IHintDialogFragmentListener> listeners = new LinkedList<>();