Always on without ambient mode? OR do not dim when enter ambient?

我的梦境 提交于 2019-12-20 04:16:36

问题


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.

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.

Anyone has any clue?


回答1:


You may try

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

in your activity's onCreate() or use

android:keepScreenOn="true"

in your activity's layout. See this training material for details.



来源:https://stackoverflow.com/questions/34971530/always-on-without-ambient-mode-or-do-not-dim-when-enter-ambient

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!