Android - Know when user turns to left or right

旧时模样 提交于 2019-12-13 03:23:55

问题


I am making a GPS-Like App and I need to know when the user turns left or right (his heading) to change the rotation of the position marker.

I've tried this

and this

But none of them is working, the first one just randomly changes even if I haven't totally turned and the second one just works if you change the device from horizontal to vertical or viceversa.

Can someone give me a hand please?

Thanks.

来源:https://stackoverflow.com/questions/52626704/android-know-when-user-turns-to-left-or-right

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