简体   繁体   中英

Proximity sensor method android

我在使用接近传感器时无法实现一种方法。我想使用接近传感器的值,以便在特定时间间隔内传感器的事件值保持不变时执行任务。我们可以为此使用计时器吗?

I am not sure, but will a onSensorChanged() -Event be raised? If so, compare the time from last event here and if it is in your interval call your method, else update time from last event to current event.

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