在没有环境模式的情况下始终开启?或进入环境时不暗淡? [英] Always on without ambient mode? OR do not dim when enter ambient?
问题描述
出于实验/用户学习的目的,我需要将屏幕保持几分钟的状态.
我已遵循 http://developer.android.com/training中的指南/wearables/apps/always-on.html ,它部分出于我的目的起作用.
该代码允许我的屏幕始终处于开机状态,但几秒钟后它将进入环境模式.我不要环境模式.
For experiment/user study purpose, I need to keep my screen on for few minutes.
I have follow the guide from http://developer.android.com/training/wearables/apps/always-on.html and it works partially for my purpose.
The code allows my screen always on BUT it will enter ambient mode after few seconds. I DO NOT want ambient mode.
我的把戏是我注释了onEnterAmbient(),onUpdateAmbient()和onExitAmbient().
这样我的屏幕绘图仍然是相同的颜色(不会更改为黑白).
进入环境模式时,屏幕变暗但变暗.
我不希望使用DIMMED效果,我需要在用户学习期间保持屏幕尽可能明亮.
My trick is I commented out onEnterAmbient(), onUpdateAmbient() and onExitAmbient().
So that my screen drawing is still the same color (not changing to black & white).
HOWEVER the screen is DIMMED darker when entering ambient mode.
I don't want the DIMMED effect, I need to keep my screen as bright as possible for the duration of my user study.
有人知道吗?
推荐答案
您可以尝试
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
在活动的 onCreate()
中或使用
android:keepScreenOn="true"
在您的活动布局中.有关详细信息,请参见此培训材料.
in your activity's layout. See this training material for details.
这篇关于在没有环境模式的情况下始终开启?或进入环境时不暗淡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!