From ec40f340e67d3202e88b5cb5bb1ddc0e1aae5495 Mon Sep 17 00:00:00 2001 From: uykek Date: Sun, 23 Aug 2020 16:59:23 +0200 Subject: [PATCH] Fix bug that caused navigation bar item "import sudoku" to be selected instead of "main menu" after cancelling the ImportBoardDialog in the MainActivity. --- .../org/secuso/privacyfriendlysudoku/ui/MainActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java index 8a4f6fa..c3d1f18 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/MainActivity.java @@ -474,7 +474,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig } public void onDialogNegativeClick() { - + mNavigationView.setCheckedItem(R.id.nav_newgame_main); } public static class ImportBoardDialog extends DialogFragment { @@ -505,7 +505,9 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig }) .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { - // User cancelled the dialog + for(IImportDialogFragmentListener l : listeners) { + l.onDialogNegativeClick(); + } } }); return builder.create();