From 1c1ea14b3c1dd48ebe756810926e013e12c49acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandra=20Ke=C3=9Fler?= Date: Fri, 11 Aug 2017 23:58:45 +0200 Subject: [PATCH] remove old handler if it was set --- app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java index 761d8aa312..1afbac3b9f 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java @@ -60,6 +60,8 @@ public class RuffyScripter { public void start(IRuffyService newService) { try { + if(ruffyService!=null) + try{ruffyService.removeHandler(mHandler);}catch(Exception e){}; if(newService!=null) { this.ruffyService = newService; // TODO this'll be done better in v2 via ConnectionManager