From e6c28990874bccf5dadd6bd67a41e4d7463d4b3b Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Mon, 10 Mar 2014 15:13:29 +0100 Subject: Automatically pair subscriptions in onResume/onPause --- main/src/cgeo/geocaching/sensors/GeoDirHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main/src/cgeo/geocaching/sensors') diff --git a/main/src/cgeo/geocaching/sensors/GeoDirHandler.java b/main/src/cgeo/geocaching/sensors/GeoDirHandler.java index 523fb1f..917b9ff 100644 --- a/main/src/cgeo/geocaching/sensors/GeoDirHandler.java +++ b/main/src/cgeo/geocaching/sensors/GeoDirHandler.java @@ -42,13 +42,14 @@ public abstract class GeoDirHandler { * Register the current GeoDirHandler for GeoData and direction information (if the * preferences allow it). */ - public void start() { + public Subscription start() { subscription = app.geoDirObservable().subscribe(new Action1>() { @Override public void call(final ImmutablePair geoDir) { handleGeoDir(geoDir); } }, AndroidSchedulers.mainThread()); + return subscription; } /** -- cgit v1.1