DeadReckoning implements SensorEventListener, SensorCollector, DownloadListener<Map<String, Collection>> { public void startSensors() { sensorManager.registerListener(this, sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL); sensorManager.registerListener(this, sensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD), SensorManager.SENSOR_DELAY_NORMAL); sensorManager.registerListener(this, sensorManager.getDefaultSensor(Sensor.TYPE_LINEAR_ACCELERATION), SensorManager.SENSOR_DELAY_NORMAL); if(accumulateDeltaTimer == null){ accumulateDeltaTimer = new Timer("accumulateDeltaTimer"); } timerTask = new TimerTask() { @Override public void run() { calculateDeltaLoop(); } }; accumulateDeltaTimer.schedule(timerTask, 10, timestep); } DeadReckoning(final Activity activity); void startSensors(); void stopSensors(); @Override void onDownloadFinished(DownloadTask task, boolean success, Map<String, Collection> data); @Override void onSensorChanged(final SensorEvent event); @Override void onAccuracyChanged(final Sensor sensor, final int accuracy); NicGeoPoint getDelta(); void setCompassFilterEnabled(boolean useLowPassFilter); void setBaseAngle(final double baseAngle);  }
@Test public void testDoubleStart() { deadReckoning.startSensors(); deadReckoning.startSensors(); }