From 16d2c887834a6592ca1cffc17d1ac503409f769b Mon Sep 17 00:00:00 2001 From: Georg Lukas Date: Sat, 30 Jul 2011 14:10:22 +0200 Subject: [PATCH] only register message broadcastreceiver once --- src/AprsService.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/AprsService.scala b/src/AprsService.scala index 1bac66b..4a46d7e 100644 --- a/src/AprsService.scala +++ b/src/AprsService.scala @@ -113,15 +113,14 @@ class AprsService extends Service with LocationListener { if (!running) { running = true startPoster() + + // register for outgoing message notifications + registerReceiver(msgNotifier, new IntentFilter(AprsService.MESSAGE)) } // continuous GPS tracking for single shot mode requestLocations(singleShot) - // register for outgoing message notifications - registerReceiver(msgNotifier, new IntentFilter(AprsService.MESSAGE)) - - val callssid = prefs.getCallSsid() val message = "%s: %d min, %d km".format(callssid, upd_int, upd_dist) ServiceNotifier.instance.start(this, message)