incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [8/11] android commit: Add onReset to CompassListener.
Date Mon, 24 Sep 2012 18:38:34 GMT
Add onReset to CompassListener.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/20c88541
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/20c88541
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/20c88541

Branch: refs/heads/master
Commit: 20c885418e97759a15b9b6564d2f87fcd812dac6
Parents: 9318ee3
Author: Braden Shepherdson <braden@chromium.org>
Authored: Mon Sep 24 11:40:06 2012 -0400
Committer: Braden Shepherdson <braden@chromium.org>
Committed: Mon Sep 24 11:40:06 2012 -0400

----------------------------------------------------------------------
 .../src/org/apache/cordova/CompassListener.java    |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/20c88541/framework/src/org/apache/cordova/CompassListener.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CompassListener.java b/framework/src/org/apache/cordova/CompassListener.java
index 83fcdd0..458afaf 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
     //--------------------------------------------------------------------------


Mime
View raw message