简体   繁体   中英

TYPE_MAGNETIC_FIELD Android No data

I have written some simple code for the Galaxy Tab 7 to show the TYPE_MAGNETIC_FIELD data. Unfortunately this does not provide any data.

I can see a TYPE_MAGNETIC_FIELD sensor (have checked it exists). I can successfully add a an event listener to it, however I never get any data from it. Other sensors work fine such as light and accelerometer. This is on a Galaxy Tab 7.

onSensorChanged(SensorEvent event) is never fired for a case Sensor.TYPE_MAGNETIC_FIELD:

As such I get no data from the Magnetic Field Sensor.

Anyone else getting this problem or know of a solution to it ?

Many Thanks.

Turns out the Sensor was broken. =((

I also faced this problem. In my case a magnetic sensor didn't work. I made sure in it after installing some compass applications and https://play.google.com/store/apps/details?id=scd.atools .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM