Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
近接センサーの使用中にメソッドを実装できませんでした。近接センサーの値を使用して、センサーのイベント値が特定の時間間隔で同じままである場合にタスクを実行したかったのですが、そのためにタイマーを使用できますか?
よくわかりませんが、onSensorChanged()イベントは発生しますか? その場合は、ここで最後のイベントからの時間を比較し、間隔内にある場合はメソッドを呼び出し、そうでない場合は最後のイベントから現在のイベントまでの時間を更新します。
onSensorChanged()