only register message broadcastreceiver once

service_trace
Georg Lukas 2011-07-30 14:10:22 +02:00
rodzic faa91619c7
commit 16d2c88783
1 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -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)