我正在使用SensorEventListener来获取重力。但是我只希望重力在x方向上工作。
To be more specific from the answer from Rajnikant, look here : http://developer.android.com/reference/android/hardware/SensorEvent.html#values
values[0] gives you the acceleration on the X-axis...
请在Sensor.TYPE_ACCELEROMETER部分下参阅此内容。
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.