diff --git a/app/src/main/java/com/ericsson/uecontrol/core/UeControlExecutor.java b/app/src/main/java/com/ericsson/uecontrol/core/UeControlExecutor.java index 1cbb6a0..0801c0e 100755 --- a/app/src/main/java/com/ericsson/uecontrol/core/UeControlExecutor.java +++ b/app/src/main/java/com/ericsson/uecontrol/core/UeControlExecutor.java @@ -87,8 +87,8 @@ public class UeControlExecutor implements Runnable{ } private void terminateNonBlock(){ - handler.removeCallbacks(throughputUpdateRunnable); terminate = true; + handler.removeCallbacks(throughputUpdateRunnable); if(currentlyActive != null) currentlyActive.terminate(); } @@ -196,8 +196,10 @@ public class UeControlExecutor implements Runnable{ } if (throughputListener != null && uploadSpeed.isUpdated()) throughputListener.throughputUpdate(downloadSpeed.getBitThroughput(), uploadSpeed.getBitThroughput()); + // Rescedule this handler - handler.postDelayed(this, 100); + if(!terminate) + handler.postDelayed(this, 100); } protected boolean setRealDataUsage(){