阅读背景:

在非活动类中访问多个传感器

来源:互联网 

I am trying to use multiple sensors like Accelerator,Magnetic Field, Light and so on and for each sensor I wrote an individual class which not an activity , each of them has its SensorEventListener as well. What I want to do is when user chooses one of them I start to show the data on a fragment(on MainActivity) , when user changes the previous sensor should stop and new one should start. However, when I try to stop previous one by unregistering its listener , it doesn't unregister but it registers and works. I want to stop previous listener. What is wrong? Any ideas?I am trying to use multiple sensors like Accele




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: