From 9177307c379a20db93782a2e76950b18aeec0040 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Mon, 19 Mar 2018 21:13:50 +0100 Subject: [PATCH] TDD 09 - fix no data --- .../info/nightscout/androidaps/TDDStatsActivity.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java b/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java index 6954e93a69..4f38490686 100644 --- a/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/TDDStatsActivity.java @@ -386,14 +386,9 @@ public class TDDStatsActivity extends Activity { TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); - + sum = sum + tdd; i++; - if(df.format(new Date(historyList.get(0).date)).equals(df.format(new Date()))) { - break; - } - - sum = sum + tdd; // Create the cumtable row TableRow ctr = new TableRow(TDDStatsActivity.this); if (i % 2 == 0) ctr.setBackgroundColor(Color.DKGRAY); @@ -435,7 +430,7 @@ public class TDDStatsActivity extends Activity { tl.setBackgroundColor(Color.TRANSPARENT); } - if(!historyList.isEmpty() && df.format(new Date(historyList.get(0).date)).equals(df.format(new Date()))) { + if(df.format(new Date(historyList.get(0).date)).equals(df.format(new Date()))) { //Today should not be included historyList.remove(0); }