From dc45d01120af743e780aca58c916d8fdf1c278f6 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 24 Mar 2017 23:03:55 +0100 Subject: [PATCH] changle loading initial status --- .../java/info/nightscout/androidaps/MainApp.java | 15 +++++++++++++++ .../androidaps/plugins/DanaR/DanaRPlugin.java | 12 ------------ .../plugins/DanaRKorean/DanaRKoreanPlugin.java | 12 ------------ 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index 67057f1e9d..6568e03a53 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import info.nightscout.androidaps.db.DatabaseHelper; import info.nightscout.androidaps.interfaces.PluginBase; +import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.plugins.Actions.ActionsFragment; import info.nightscout.androidaps.plugins.Careportal.CareportalFragment; import info.nightscout.androidaps.plugins.CircadianPercentageProfile.CircadianPercentageProfileFragment; @@ -119,6 +120,20 @@ public class MainApp extends Application { MainApp.getConfigBuilder().uploadAppStart(); startKeepAliveService(); + + Thread t = new Thread(new Runnable() { + @Override + public void run() { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + } + PumpInterface pump = MainApp.getConfigBuilder(); + if (pump != null) + pump.refreshDataFromPump("Initialization"); + } + }); + t.start(); } private void startKeepAliveService() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java index cb4e1b5bce..4a2d9d3a56 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java @@ -106,18 +106,6 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf pumpDescription.basalMinimumRate = 0.04d; pumpDescription.isRefillingCapable = true; - - Thread t = new Thread(new Runnable() { - @Override - public void run() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - } - refreshDataFromPump("Initialization"); - } - }); - t.start(); } ServiceConnection mConnection = new ServiceConnection() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java index ae541abbb6..11debc415a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java @@ -108,18 +108,6 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints pumpDescription.basalMinimumRate = 0.1d; pumpDescription.isRefillingCapable = true; - - Thread t = new Thread(new Runnable() { - @Override - public void run() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - } - refreshDataFromPump("Initialization"); - } - }); - t.start(); } ServiceConnection mConnection = new ServiceConnection() {