From 39e83f0cfeaed2e7cf32c029722122c4815a017b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 28 Jun 2017 10:24:42 +0200 Subject: [PATCH] clean context after fragment is destroyed --- .../plugins/Careportal/Dialogs/NewNSTreatmentDialog.java | 6 ++++++ .../plugins/Overview/Dialogs/CalibrationDialog.java | 6 ++++++ .../androidaps/plugins/Overview/Dialogs/WizardDialog.java | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java index 8158111cf6..f440311d18 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java @@ -141,6 +141,12 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick super.onAttach(activity); } + @Override + public void onDetach() { + super.onDetach(); + this.context = null; + } + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/CalibrationDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/CalibrationDialog.java index 96ec8f2ba4..fdc58e92f4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/CalibrationDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/CalibrationDialog.java @@ -46,6 +46,12 @@ public class CalibrationDialog extends DialogFragment implements View.OnClickLis this.context = context; } + @Override + public void onDetach() { + super.onDetach(); + this.context = null; + } + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java index b1edad4de4..b50ea56d89 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/WizardDialog.java @@ -123,6 +123,12 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com this.context = context; } + @Override + public void onDetach() { + super.onDetach(); + this.context = null; + } + @Override public void onResume() { super.onPause();