From 8fa081e4b7a69750bf78f566b0a693995d967978 Mon Sep 17 00:00:00 2001 From: Clayton Wilson Date: Fri, 9 Oct 2020 02:15:08 -0400 Subject: [PATCH] Fix creating list from hamburger menu --- .../java/com/example/listify/CreateListDialogFragment.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Listify/app/src/main/java/com/example/listify/CreateListDialogFragment.java b/Listify/app/src/main/java/com/example/listify/CreateListDialogFragment.java index 56e0473..d8b0cec 100644 --- a/Listify/app/src/main/java/com/example/listify/CreateListDialogFragment.java +++ b/Listify/app/src/main/java/com/example/listify/CreateListDialogFragment.java @@ -61,6 +61,9 @@ public class CreateListDialogFragment extends DialogFragment { super.onAttach(context); try { onNewListListener = (OnNewListListener) getTargetFragment(); + if (onNewListListener == null) { + onNewListListener = (OnNewListListener) getActivity(); + } } catch (ClassCastException e) { Log.e("CreateListDialogFragment", "onAttach: ClassCastException: " + e.getMessage()); }