diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/view/fragment/PreviewFragment.java b/app/src/main/java/com/wbrawner/simplemarkdown/view/fragment/PreviewFragment.java index 4b1a461..d66796f 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/view/fragment/PreviewFragment.java +++ b/app/src/main/java/com/wbrawner/simplemarkdown/view/fragment/PreviewFragment.java @@ -71,8 +71,12 @@ public class PreviewFragment extends Fragment implements MarkdownPreviewView { @Override public void onDestroyView() { - super.onDestroyView(); + if (markdownPreview != null) { + ((ViewGroup) markdownPreview.getParent()).removeView(markdownPreview); + markdownPreview.destroy(); + } unbinder.unbind(); + super.onDestroyView(); } @Override