Example usage for android.hardware SensorManager SENSOR_DELAY_NORMAL

List of usage examples for android.hardware SensorManager SENSOR_DELAY_NORMAL

Introduction

In this page you can find the example usage for android.hardware SensorManager SENSOR_DELAY_NORMAL.

Prototype

int SENSOR_DELAY_NORMAL

To view the source code for android.hardware SensorManager SENSOR_DELAY_NORMAL.

Click Source Link

Document

rate (default) suitable for screen orientation changes

Usage

From source file:com.zoffcc.applications.zanavi.Navit.java

public void turn_on_compass() {
    try {//  www . j av  a 2  s  .  c o m
        if (!p.PREF_use_compass_heading_fast)

        {
            // Slower
            sensorManager.registerListener(this, sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION),
                    SensorManager.SENSOR_DELAY_NORMAL);
        } else {
            // FAST
            sensorManager.registerListener(this, sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION),
                    SensorManager.SENSOR_DELAY_UI);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}