aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/speech
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-03-10 15:38:10 +0100
committerSamuel Tardieu <sam@rfc1149.net>2014-03-10 15:45:12 +0100
commit638e06a1cd98a12bb1e0f86bd0770141abdabae9 (patch)
tree9c9b65c92328184d91d01491d14ca4ab467ad7b7 /main/src/cgeo/geocaching/speech
parente6c28990874bccf5dadd6bd67a41e4d7463d4b3b (diff)
downloadcgeo-638e06a1cd98a12bb1e0f86bd0770141abdabae9.zip
cgeo-638e06a1cd98a12bb1e0f86bd0770141abdabae9.tar.gz
cgeo-638e06a1cd98a12bb1e0f86bd0770141abdabae9.tar.bz2
Use a subscription model for GeoDirHandler
Diffstat (limited to 'main/src/cgeo/geocaching/speech')
-rw-r--r--main/src/cgeo/geocaching/speech/SpeechService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/speech/SpeechService.java b/main/src/cgeo/geocaching/speech/SpeechService.java
index b13218c..086227d 100644
--- a/main/src/cgeo/geocaching/speech/SpeechService.java
+++ b/main/src/cgeo/geocaching/speech/SpeechService.java
@@ -17,6 +17,7 @@ import android.os.IBinder;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.Engine;
import android.speech.tts.TextToSpeech.OnInitListener;
+import rx.Subscription;
import java.util.Locale;
@@ -75,6 +76,7 @@ public class SpeechService extends Service implements OnInitListener {
private long lastSpeechTime = 0;
private float lastSpeechDistance = 0.0f;
private Geopoint target;
+ private Subscription initSubscription;
@Override
public IBinder onBind(Intent intent) {
@@ -106,7 +108,7 @@ public class SpeechService extends Service implements OnInitListener {
@Override
public void onDestroy() {
- geoDirHandler.stop();
+ initSubscription.unsubscribe();
if (tts != null) {
tts.stop();
tts.shutdown();
@@ -141,7 +143,7 @@ public class SpeechService extends Service implements OnInitListener {
initialized = true;
- geoDirHandler.start();
+ initSubscription = geoDirHandler.start();
}
@Override