From 248d3d1697f1c2858ba5e4dbdd58d7461810e920 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 22 Dec 2017 20:34:53 +0100 Subject: [PATCH] proper select last used profile --- .../plugins/Careportal/Dialogs/NewNSTreatmentDialog.java | 2 +- .../androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 92c287f888..40eab27a5e 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 @@ -175,7 +175,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick profileSpinner.setAdapter(adapter); // set selected to actual profile for (int p = 0; p < profileList.size(); p++) { - if (profileList.get(p).equals(MainApp.getConfigBuilder().getProfileName())) + if (profileList.get(p).equals(MainApp.getConfigBuilder().getProfileName(false))) profileSpinner.setSelection(p); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index 3dfd8dcd55..a7cedc6381 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -736,6 +736,10 @@ public class ConfigBuilderPlugin implements PluginBase, ConstraintsInterface, Tr return getProfileName(System.currentTimeMillis()); } + public String getProfileName(boolean customized) { + return getProfileName(System.currentTimeMillis(), customized); + } + public String getProfileName(long time) { return getProfileName(time, true); }