Code example for SensorManager

Methods: getDefaultSensorregisterListener

    protected void onFirstObserver() { 
        sensorManager.registerListener(this, sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION), SensorManager.SENSOR_DELAY_NORMAL);
    protected void onLastObserver() { 
    public void onAccuracyChanged(final Sensor sensor, int accuracy) {
         * There is a bug in Android, which apparently causes this method to be called every 
         * time the sensor _value_ changed, even if the _accuracy_ did not change. So logging 
         * this event leads to the log being flooded with multiple entries _per second_, 
         * which I experienced when running cgeo in a building (with GPS and network being 
Stop searching for code, let great code find you!  Add Codota to your java IDE