Skip to content

Commit

Permalink
- adding catch in case trying to show a dialog fragment and the activ…
Browse files Browse the repository at this point in the history
…ity closes
  • Loading branch information
ncapdevi committed Nov 29, 2016
1 parent fd64e86 commit e77ea50
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
}
}

Expand Down

0 comments on commit e77ea50

Please sign in to comment.