diff --git a/framework/src/org/apache/cordova/CompassListener.java b/framework/src/org/apache/cordova/CompassListener.java index 83fcdd0a..458afaf4 100755 --- a/framework/src/org/apache/cordova/CompassListener.java +++ b/framework/src/org/apache/cordova/CompassListener.java @@ -33,6 +33,8 @@ import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.content.Context; +import android.util.Log; + /** * This class listens to the compass sensor and stores the latest heading value. */ @@ -166,6 +168,13 @@ public class CompassListener extends Plugin implements SensorEventListener { this.stop(); } + /** + * Called when app has navigated and JS listeners have been destroyed. + */ + public void onReset() { + this.stop(); + } + //-------------------------------------------------------------------------- // LOCAL METHODS //--------------------------------------------------------------------------