diff --git a/frag-nav/src/main/java/com/ncapdevi/fragnav/FragNavController.java b/frag-nav/src/main/java/com/ncapdevi/fragnav/FragNavController.java index d68fbde5..36818bbb 100644 --- a/frag-nav/src/main/java/com/ncapdevi/fragnav/FragNavController.java +++ b/frag-nav/src/main/java/com/ncapdevi/fragnav/FragNavController.java @@ -622,7 +622,11 @@ public void showDialogFragment(DialogFragment dialogFragment) { } mCurrentDialogFrag = dialogFragment; - dialogFragment.show(fragmentManager, dialogFragment.getClass().getName()); + try { + dialogFragment.show(fragmentManager, dialogFragment.getClass().getName()); + } catch(IllegalStateException e){ + // Activity was likely destroyed before we had a chance to show, nothing can be done here. + } } }