Add onReset to CompassListener.

This commit is contained in:
Braden Shepherdson 2012-09-24 11:40:06 -04:00
parent 9318ee30bd
commit 20c885418e

View File

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