Android SensorManager error in LogCat

南笙酒味 提交于 2019-12-01 22:53:00

问题


I have a problem with the sensor manager and errors in the logcat. When I register the listener with this line :

sensorMgr.registerListener(this, sensorMgr.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL);

I recieve theses lines in the logcat with three errors.

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

It works great, there is no problem but how can I avoid these errors ?

PS : I don't use the deprecated version.


回答1:


It's not an error, this is a normal behavior, they marked it as error by mistake. You can run it on an ICS device and see the same log line in a "debug" log-type.



来源:https://stackoverflow.com/questions/10938131/android-sensormanager-error-in-logcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!