diff --git a/.idea/misc.xml b/.idea/misc.xml index fbb68289f4..5d19981032 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java index a0f9cc3329..41afa4c357 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewExtendedBolusDialog.java @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.Overview.Dialogs; +import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.os.Handler; @@ -89,7 +90,8 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli final Double finalInsulin = insulin; final int finalDurationInMinutes = durationInMinutes; - AlertDialog.Builder builder = new AlertDialog.Builder(this.getContext()); + final Context context = getContext(); + AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(this.getContext().getString(R.string.confirmation)); builder.setMessage(confirmMessage); builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() { @@ -100,7 +102,7 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli public void run() { PumpEnactResult result = pump.setExtendedBolus(finalInsulin, finalDurationInMinutes); if (!result.success) { - AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); + AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(getContext().getString(R.string.treatmentdeliveryerror)); builder.setMessage(result.comment); builder.setPositiveButton(getContext().getString(R.string.ok), null);