机器人:关闭屏幕时接近的脸 [英] android: turn off screen when close to face
本文介绍了机器人:关闭屏幕时接近的脸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序允许用户访问他们的企业语音邮件的用户。通常情况下,durring当用户将设备一直到他们的耳朵一个电话,屏幕关闭,以便他们不会不小心按下按钮与他们的脸。我想使我的应用程序做同样的事情,当用户正在收听的语音邮件。
My app allows the user to access their corporate voice mail. Normally, durring a phone call when the user holds the device up to their ear, the screen shuts off so they wont accidentally push buttons with their face. I would like to make my app do the same thing when the user is listening to their voice mail.
任何人都知道如何做到这一点?
anyone know how to do this?
推荐答案
你们看到的是采用接近传感器。对于有一个设备,您可以通过 的SensorManager 访问code>
。
What you are seeing is the use of a proximity sensor. For devices that have one, you access it through SensorManager
.
这篇关于机器人:关闭屏幕时接近的脸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文