Android Wear的检测环境屏模式 [英] Android Wear detect ambient screen mode
问题描述
有没有一种方法,以检测当手表使用环境中屏幕模式?我做一个表盘,并希望继续更新时钟时,周围的屏幕模式开启(时钟显示在屏幕上),但我想停止更新当屏幕处于关闭状态。现在,我开始和停止在的onPause
更新和 onResume
的方法,但是的onPause
方法,当环境屏幕模式亮起调用。
Is there a way to detect when the watch is in ambient screen mode? I make a watch face and want to continue to update the clock when the ambient screen mode is on (clock is shown on screen), but I want to stop updating when the screen is off. For now, I start and stop the update in onPause
and onResume
methods, but the onPause
method is called when the ambient screen mode comes on.
感谢。
推荐答案
要通知周围的模式改变了,你必须使用一个 DisplayListener
。
你可以找到做 rel=\"nofollow\">方式
To be notified of the Ambient mode changed, you have to use a DisplayListener
.
You can find the way to do that here
这篇关于Android Wear的检测环境屏模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!