传感器管理器出现问题,logcat出现错误。 当我用这一行注册听众时:
sensorMgr.registerListener(this, sensorMgr.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL);
我在logcat中收到了三行错误。
06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 1
06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 2
06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 3
06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 4
06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 5
06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 6
06-07 20:52:42.419: D/SensorManager(9215): ====>>>>>Num Sensor: 0
06-07 20:52:42.419: E/SensorManager(9215): registerListener :: handle = 0 name= BMA220 delay= 200000 Listener= fr.rocknscrum.liseronmobile.MainActivity@40520980
06-07 20:52:42.419: E/SensorManager(9215): =======>>>Sensor Thread RUNNING <<<========
06-07 20:52:42.429: E/SensorManager(9215): reg :: handle = 0
效果很好,没有问题,但我怎样才能避免这些错误?
PS:我不使用已弃用的版本。
答案 0 :(得分:4)
这不是错误,这是正常行为,他们错误地将其标记为错误。您可以在ICS设备上运行它,并在“调试”日志类型中查看相同的日志行。