开发者

Still receiving sensor events after unregisterListener

开发者 https://www.devze.com 2023-02-28 08:35 出处:网络
I have noticed a lag between calling unregisterListener and when sensor events stop coming to my service. Is this normal? Is there a way to immediately stop receiving sensor 开发者_如何学JAVAevents?

I have noticed a lag between calling unregisterListener and when sensor events stop coming to my service. Is this normal? Is there a way to immediately stop receiving sensor 开发者_如何学JAVAevents?

-- George


If the events fast then you may end up with more events than you want. Just set a boolean variable in your Listener and flip it as soon as you detected your first event. You can use that boolean then to determine if you want to continue with the code or not.

0

精彩评论

暂无评论...
验证码 换一张
取 消